From 6944d3485ad005c6cd69a3122479f1fbaef26dfc Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Tue, 18 Jun 2013 01:44:39 +0200
Subject: GLDynamicLibraryBundleInfo.shallLinkGlobal(): Defaults to 'true' now,
allowing to remove specialized values.
- Windows always used global
- The OpenGL library is always available by all processes system wide.
- Tested on OSX (was using local, previously).
---
.../jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java | 10 ----------
1 file changed, 10 deletions(-)
(limited to 'src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java')
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index cddd142e9..771d16d46 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -47,16 +47,6 @@ public class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBundleIn
super();
}
- /**
- * Might be a desktop GL library, and might need to allow symbol access to subsequent libs.
- *
- * This respects old DRI requirements:
- *
+ */
@Override
public boolean shallLookupGlobal() { return false; }
@Override
- public RunnableExecutor getLibLoaderExecutor() {
+ 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 d2dac8148..1ed73f15e 100644
--- a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
@@ -36,7 +36,7 @@ public class GLDynamicLookupHelper extends DynamicLibraryBundle {
super(info);
}
- public GLDynamicLibraryBundleInfo getGLBundleInfo() { return (GLDynamicLibraryBundleInfo) getBundleInfo(); }
+ public final GLDynamicLibraryBundleInfo getGLBundleInfo() { return (GLDynamicLibraryBundleInfo) getBundleInfo(); }
/** NOP per default */
public boolean loadGLULibrary() { return false; }
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index 771d16d46..3d59d1d53 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -36,8 +36,8 @@ import jogamp.opengl.*;
* Implementation of the DynamicLookupHelper for Desktop ES2 (AMD, ..)
* where EGL and ES2 functions reside within the desktop OpenGL library.
*/
-public class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo {
- static List glueLibNames;
+public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo {
+ static final List glueLibNames;
static {
glueLibNames = new ArrayList();
glueLibNames.add("jogl_mobile");
@@ -61,7 +61,7 @@ public class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBundleIn
return true;
}
- public List> getToolLibNames() {
+ public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
final List libsGL = new ArrayList();
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index 2b8ca31c9..b54ed6599 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -259,8 +259,7 @@ public class EGLContext extends GLContextImpl {
protected final StringBuilder getPlatformExtensionsStringImpl() {
StringBuilder sb = new StringBuilder();
if (!eglQueryStringInitialized) {
- eglQueryStringAvailable =
- getDrawableImpl().getGLDynamicLookupHelper().dynamicLookupFunction("eglQueryString") != 0;
+ eglQueryStringAvailable = getDrawableImpl().getGLDynamicLookupHelper().isFunctionAvailable("eglQueryString");
eglQueryStringInitialized = true;
}
if (eglQueryStringAvailable) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index adb78b3b9..79d1fad62 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -91,9 +91,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
private static final boolean isANGLE(GLDynamicLookupHelper dl) {
if(Platform.OSType.WINDOWS == Platform.OS_TYPE) {
- final boolean r = 0 != dl.dynamicLookupFunction("eglQuerySurfacePointerANGLE") ||
- 0 != dl.dynamicLookupFunction("glBlitFramebufferANGLE") ||
- 0 != dl.dynamicLookupFunction("glRenderbufferStorageMultisampleANGLE");
+ final boolean r = dl.isFunctionAvailable("eglQuerySurfacePointerANGLE") ||
+ dl.isFunctionAvailable("glBlitFramebufferANGLE") ||
+ dl.isFunctionAvailable("glRenderbufferStorageMultisampleANGLE");
return r;
} else {
return false;
@@ -101,9 +101,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
private static final boolean includesES1(GLDynamicLookupHelper dl) {
- return 0 != dl.dynamicLookupFunction("glLoadIdentity") &&
- 0 != dl.dynamicLookupFunction("glEnableClientState") &&
- 0 != dl.dynamicLookupFunction("glColorPointer");
+ return dl.isFunctionAvailable("glLoadIdentity") &&
+ dl.isFunctionAvailable("glEnableClientState") &&
+ dl.isFunctionAvailable("glColorPointer");
}
public EGLDrawableFactory() {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
index 26b199ea2..9f4a4d2c2 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
@@ -42,7 +42,7 @@ import jogamp.opengl.*;
* Currently two implementations exist, one for ES1 and one for ES2.
*/
public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo {
- static List glueLibNames;
+ static final List glueLibNames;
static {
glueLibNames = new ArrayList();
glueLibNames.add("jogl_mobile");
@@ -57,7 +57,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
* and false otherwise.
*/
@Override
- public boolean shallLookupGlobal() {
+ public final boolean shallLookupGlobal() {
if ( Platform.OSType.ANDROID == Platform.OS_TYPE ) {
// Android requires global symbol lookup
return true;
@@ -88,7 +88,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
}
}
- protected List getEGLLibNamesList() {
+ protected final List getEGLLibNamesList() {
List eglLibNames = new ArrayList();
// this is the default EGL lib name, according to the spec
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
index 0a373eb7f..dd3d6faea 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
@@ -30,12 +30,12 @@ package jogamp.opengl.egl;
import java.util.*;
-public class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo {
+public final class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo {
protected EGLES1DynamicLibraryBundleInfo() {
super();
}
- public List> getToolLibNames() {
+ public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
{
final List libsGL = new ArrayList();
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
index d4ee852b1..d83acdb6b 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
@@ -30,12 +30,12 @@ package jogamp.opengl.egl;
import java.util.*;
-public class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo {
+public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo {
protected EGLES2DynamicLibraryBundleInfo() {
super();
}
- public List> getToolLibNames() {
+ public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
{
final List libsGL = new ArrayList();
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
index 03ec94db6..f8c874a53 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
@@ -31,13 +31,13 @@ package jogamp.opengl.macosx.cgl;
import jogamp.opengl.*;
import java.util.*;
-public class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo {
+public final class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo {
protected MacOSXCGLDynamicLibraryBundleInfo() {
super();
}
@Override
- public List> getToolLibNames() {
+ public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
final List libsGL = new ArrayList();
libsGL.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
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 883c13f51..2d40fe4ec 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -55,10 +55,10 @@ import com.jogamp.common.util.RunnableExecutor;
* Tue Feb 28 12:07:53 2012 322537478b63c6bc01e640643550ff539864d790 minor 1 -> 2
*/
class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
- private static List glueLibNames = new ArrayList(); // none
+ private static final List glueLibNames = new ArrayList(); // none
private static final int symbolCount = 31;
- private static String[] symbolNames = {
+ private static final String[] symbolNames = {
"avcodec_version",
"avformat_version",
/* 3 */ "avutil_version",
@@ -99,7 +99,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
};
// alternate symbol names
- private static String[][] altSymbolNames = {
+ private static final String[][] altSymbolNames = {
{ "avcodec_open", "avcodec_open2" }, // old, 53.6.0
{ "avcodec_decode_audio3", "avcodec_decode_audio4" }, // old, 53.25.0
{ "av_close_input_file", "avformat_close_input" }, // old, 53.17.0
@@ -107,7 +107,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
};
// optional symbol names
- private static String[] optionalSymbolNames = {
+ private static final String[] optionalSymbolNames = {
"avformat_free_context", // 52.96.0 (opt)
"avformat_network_init", // 53.13.0 (opt)
"avformat_network_deinit", // 53.13.0 (opt)
@@ -133,7 +133,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
static boolean initSingleton() { return ready; }
- private static boolean initSymbols() {
+ private static final boolean initSymbols() {
final DynamicLibraryBundle dl = AccessController.doPrivileged(new PrivilegedAction() {
public DynamicLibraryBundle run() {
return new DynamicLibraryBundle(new FFMPEGDynamicLibraryBundleInfo());
@@ -171,9 +171,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
}
// lookup
- for(int i = 0; i() {
+ public Object run() {
+ for(int i = 0; i
+ * Returns true.
+ *
+ */
@Override
- public boolean shallLookupGlobal() { return true; }
+ public final boolean shallLookupGlobal() {
+ return true;
+ }
@Override
public final List getGlueLibNames() {
@@ -222,7 +234,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
}
@Override
- public List> getToolLibNames() {
+ public final List> getToolLibNames() {
List> libsList = new ArrayList>();
final List avutil = new ArrayList();
@@ -279,12 +291,12 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
}
@Override
- public boolean useToolGetProcAdressFirst(String funcName) {
+ public final boolean useToolGetProcAdressFirst(String funcName) {
return false;
}
@Override
- public RunnableExecutor getLibLoaderExecutor() {
+ 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 4be2bcb58..0c578f97f 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -31,6 +31,8 @@ package jogamp.opengl.util.av.impl;
import java.io.IOException;
import java.nio.Buffer;
import java.nio.ByteBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
@@ -43,9 +45,6 @@ import com.jogamp.opengl.util.texture.Texture;
import com.jogamp.opengl.util.texture.TextureSequence;
import jogamp.opengl.GLContextImpl;
-import jogamp.opengl.es1.GLES1ProcAddressTable;
-import jogamp.opengl.es2.GLES2ProcAddressTable;
-import jogamp.opengl.gl4.GL4bcProcAddressTable;
import jogamp.opengl.util.av.EGLMediaPlayerImpl;
/***
@@ -201,18 +200,29 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl {
}
setTextureFormat(tif, tf);
setTextureType(GL.GL_UNSIGNED_BYTE);
- GLContextImpl ctx = (GLContextImpl)gl.getContext();
- ProcAddressTable pt = ctx.getGLProcAddressTable();
- if(pt instanceof GLES2ProcAddressTable) {
- procAddrGLTexSubImage2D = ((GLES2ProcAddressTable)pt)._addressof_glTexSubImage2D;
- } else if(pt instanceof GLES1ProcAddressTable) {
- procAddrGLTexSubImage2D = ((GLES1ProcAddressTable)pt)._addressof_glTexSubImage2D;
- } else if(pt instanceof GL4bcProcAddressTable) {
- procAddrGLTexSubImage2D = ((GL4bcProcAddressTable)pt)._addressof_glTexSubImage2D;
- } else {
- throw new InternalError("Unknown ProcAddressTable: "+pt.getClass().getName()+" of "+ctx.getClass().getName());
+ final GLContextImpl ctx = (GLContextImpl)gl.getContext();
+ final ProcAddressTable pt = ctx.getGLProcAddressTable();
+ if( 0 == procAddrGLTexSubImage2D ) {
+ throw new InternalError("glTexSubImage2D n/a in ProcAddressTable: "+pt.getClass().getName()+" of "+ctx.getGLVersion());
}
}
+
+ /**
+ * Catches IllegalArgumentException and returns 0 if functionName is n/a,
+ * otherwise the ProcAddressTable's field value.
+ */
+ 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) {
+ return Long.valueOf(0);
+ }
+ }
+ } ).longValue();
+ }
+
private void updateAttributes2(int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
int lSz0, int lSz1, int lSz2,
int tWd0, int tWd1, int tWd2) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 5fb01d1a3..45edda516 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -43,6 +43,8 @@ package jogamp.opengl.windows.wgl;
import java.nio.Buffer;
import java.nio.ShortBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -88,19 +90,24 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
super();
synchronized(WindowsWGLDrawableFactory.class) {
- if(null==windowsWGLDynamicLookupHelper) {
- DesktopGLDynamicLookupHelper tmp = null;
- try {
- tmp = new DesktopGLDynamicLookupHelper(new WindowsWGLDynamicLibraryBundleInfo());
- } catch (GLException gle) {
- if(DEBUG) {
- gle.printStackTrace();
+ if( null == windowsWGLDynamicLookupHelper ) {
+ windowsWGLDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction() {
+ public DesktopGLDynamicLookupHelper run() {
+ DesktopGLDynamicLookupHelper tmp;
+ try {
+ tmp = new DesktopGLDynamicLookupHelper(new WindowsWGLDynamicLibraryBundleInfo());
+ if(null!=tmp && tmp.isLibComplete()) {
+ WGL.getWGLProcAddressTable().reset(tmp);
+ }
+ } catch (Exception ex) {
+ tmp = null;
+ if(DEBUG) {
+ ex.printStackTrace();
+ }
+ }
+ return tmp;
}
- }
- if(null!=tmp && tmp.isLibComplete()) {
- windowsWGLDynamicLookupHelper = tmp;
- WGL.getWGLProcAddressTable().reset(windowsWGLDynamicLookupHelper);
- }
+ } );
}
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
index a553bd4c2..7ec6c50f8 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
@@ -31,13 +31,13 @@ package jogamp.opengl.windows.wgl;
import jogamp.opengl.*;
import java.util.*;
-public class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo {
+public final class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo {
protected WindowsWGLDynamicLibraryBundleInfo() {
super();
}
@Override
- public List> getToolLibNames() {
+ public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
final List libsGL = new ArrayList();
libsGL.add("OpenGL32");
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index 394293bc0..b3b02e23f 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -39,6 +39,8 @@ package jogamp.opengl.x11.glx;
import java.nio.Buffer;
import java.nio.ShortBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -91,19 +93,24 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
super();
synchronized(X11GLXDrawableFactory.class) {
- if(null==x11GLXDynamicLookupHelper) {
- DesktopGLDynamicLookupHelper tmp = null;
- try {
- tmp = new DesktopGLDynamicLookupHelper(new X11GLXDynamicLibraryBundleInfo());
- } catch (GLException gle) {
- if(DEBUG) {
- gle.printStackTrace();
+ if( null == x11GLXDynamicLookupHelper ) {
+ x11GLXDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction() {
+ public DesktopGLDynamicLookupHelper run() {
+ DesktopGLDynamicLookupHelper tmp;
+ try {
+ tmp = new DesktopGLDynamicLookupHelper(new X11GLXDynamicLibraryBundleInfo());
+ if(null!=tmp && tmp.isLibComplete()) {
+ GLX.getGLXProcAddressTable().reset(tmp);
+ }
+ } catch (Exception ex) {
+ tmp = null;
+ if(DEBUG) {
+ ex.printStackTrace();
+ }
+ }
+ return tmp;
}
- }
- if(null!=tmp && tmp.isLibComplete()) {
- x11GLXDynamicLookupHelper = tmp;
- GLX.getGLXProcAddressTable().reset(x11GLXDynamicLookupHelper);
- }
+ } );
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
index 6083f209c..f25f7ae2c 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
@@ -31,13 +31,13 @@ package jogamp.opengl.x11.glx;
import jogamp.opengl.*;
import java.util.*;
-public class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo {
+public final class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo {
protected X11GLXDynamicLibraryBundleInfo() {
super();
}
@Override
- public List> getToolLibNames() {
+ public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
final List libsGL = new ArrayList();
--
cgit v1.2.3
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
---
.../com/jogamp/audio/windows/waveout/Audio.java | 10 +-
.../com/jogamp/audio/windows/waveout/Mixer.java | 12 +-
.../jogamp/audio/windows/waveout/SoundBuffer.java | 10 +-
.../com/jogamp/audio/windows/waveout/Track.java | 12 +-
.../com/jogamp/audio/windows/waveout/Vec3f.java | 10 +-
.../gluegen/opengl/BuildComposablePipeline.java | 18 +-
.../jogamp/gluegen/opengl/BuildStaticGLInfo.java | 38 +-
.../com/jogamp/gluegen/opengl/GLConfiguration.java | 28 +-
.../com/jogamp/gluegen/opengl/GLEmitter.java | 34 +-
.../gluegen/opengl/GLJavaMethodBindingEmitter.java | 16 +-
.../jogamp/gluegen/opengl/ant/StaticGLGenTask.java | 72 +-
.../opengl/nativesig/NativeSignatureEmitter.java | 18 +-
.../NativeSignatureJavaMethodBindingEmitter.java | 26 +-
.../gluegen/runtime/opengl/GLNameResolver.java | 20 +-
.../runtime/opengl/GLProcAddressResolver.java | 10 +-
.../com/jogamp/graph/curve/OutlineShape.java | 124 ++--
.../classes/com/jogamp/graph/curve/Region.java | 68 +-
.../com/jogamp/graph/curve/opengl/GLRegion.java | 42 +-
.../jogamp/graph/curve/opengl/RegionRenderer.java | 24 +-
.../com/jogamp/graph/curve/opengl/RenderState.java | 32 +-
.../com/jogamp/graph/curve/opengl/Renderer.java | 84 +--
.../jogamp/graph/curve/opengl/TextRenderer.java | 60 +-
.../com/jogamp/graph/curve/tess/Triangulation.java | 2 +-
.../com/jogamp/graph/curve/tess/Triangulator.java | 12 +-
src/jogl/classes/com/jogamp/graph/font/Font.java | 34 +-
.../classes/com/jogamp/graph/font/FontFactory.java | 20 +-
.../classes/com/jogamp/graph/font/FontSet.java | 16 +-
.../classes/com/jogamp/graph/geom/Outline.java | 36 +-
.../classes/com/jogamp/graph/geom/Triangle.java | 10 +-
src/jogl/classes/com/jogamp/graph/geom/Vertex.java | 22 +-
.../com/jogamp/graph/geom/opengl/SVertex.java | 40 +-
src/jogl/classes/com/jogamp/opengl/FBObject.java | 786 ++++++++++-----------
.../com/jogamp/opengl/GLAutoDrawableDelegate.java | 56 +-
.../com/jogamp/opengl/GLEventListenerState.java | 118 ++--
.../classes/com/jogamp/opengl/GLExtensions.java | 22 +-
.../com/jogamp/opengl/GLRendererQuirks.java | 64 +-
.../classes/com/jogamp/opengl/GLStateKeeper.java | 38 +-
.../opengl/GenericGLCapabilitiesChooser.java | 10 +-
.../classes/com/jogamp/opengl/JoglVersion.java | 40 +-
.../opengl/cg/CgDynamicLibraryBundleInfo.java | 24 +-
.../classes/com/jogamp/opengl/cg/CgException.java | 14 +-
.../classes/com/jogamp/opengl/math/FixedPoint.java | 12 +-
.../classes/com/jogamp/opengl/math/FloatUtil.java | 88 +--
.../classes/com/jogamp/opengl/math/Quaternion.java | 38 +-
.../classes/com/jogamp/opengl/math/VectorUtil.java | 46 +-
.../com/jogamp/opengl/math/Vert2fImmutable.java | 4 +-
.../com/jogamp/opengl/math/geom/AABBox.java | 84 +--
.../com/jogamp/opengl/math/geom/Frustum.java | 82 +--
.../classes/com/jogamp/opengl/swt/GLCanvas.java | 134 ++--
.../com/jogamp/opengl/util/AWTAnimatorImpl.java | 10 +-
.../classes/com/jogamp/opengl/util/Animator.java | 34 +-
.../com/jogamp/opengl/util/AnimatorBase.java | 106 +--
.../jogamp/opengl/util/DefaultAnimatorImpl.java | 10 +-
.../com/jogamp/opengl/util/FPSAnimator.java | 66 +-
.../com/jogamp/opengl/util/GLArrayDataClient.java | 80 +--
.../jogamp/opengl/util/GLArrayDataEditable.java | 28 +-
.../com/jogamp/opengl/util/GLArrayDataServer.java | 122 ++--
.../com/jogamp/opengl/util/GLArrayDataWrapper.java | 112 +--
.../classes/com/jogamp/opengl/util/GLBuffers.java | 388 +++++-----
.../com/jogamp/opengl/util/GLDrawableUtil.java | 50 +-
.../com/jogamp/opengl/util/GLPixelBuffer.java | 126 ++--
.../jogamp/opengl/util/GLPixelStorageModes.java | 48 +-
.../com/jogamp/opengl/util/GLReadBufferUtil.java | 62 +-
src/jogl/classes/com/jogamp/opengl/util/Gamma.java | 14 +-
.../com/jogamp/opengl/util/ImmModeSink.java | 382 +++++-----
.../classes/com/jogamp/opengl/util/PMVMatrix.java | 276 ++++----
.../com/jogamp/opengl/util/RandomTileRenderer.java | 56 +-
.../classes/com/jogamp/opengl/util/TGAWriter.java | 16 +-
.../com/jogamp/opengl/util/TileRenderer.java | 78 +-
.../com/jogamp/opengl/util/TileRendererBase.java | 148 ++--
.../classes/com/jogamp/opengl/util/TimeFrameI.java | 30 +-
.../com/jogamp/opengl/util/av/AudioSink.java | 188 ++---
.../jogamp/opengl/util/av/AudioSinkFactory.java | 10 +-
.../com/jogamp/opengl/util/av/GLMediaPlayer.java | 192 ++---
.../opengl/util/av/GLMediaPlayerFactory.java | 12 +-
.../jogamp/opengl/util/awt/AWTGLPixelBuffer.java | 78 +-
.../opengl/util/awt/AWTGLReadBufferUtil.java | 12 +-
.../com/jogamp/opengl/util/awt/ImageUtil.java | 26 +-
.../com/jogamp/opengl/util/awt/Overlay.java | 14 +-
.../com/jogamp/opengl/util/awt/Screenshot.java | 28 +-
.../com/jogamp/opengl/util/awt/TextRenderer.java | 12 +-
.../jogamp/opengl/util/awt/TextureRenderer.java | 28 +-
.../com/jogamp/opengl/util/gl2/BitmapCharRec.java | 18 +-
.../com/jogamp/opengl/util/gl2/BitmapFontRec.java | 18 +-
.../com/jogamp/opengl/util/gl2/CoordRec.java | 18 +-
.../classes/com/jogamp/opengl/util/gl2/GLUT.java | 52 +-
.../com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java | 14 +-
.../com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java | 14 +-
.../opengl/util/gl2/GLUTBitmapHelvetica10.java | 14 +-
.../opengl/util/gl2/GLUTBitmapHelvetica12.java | 14 +-
.../opengl/util/gl2/GLUTBitmapHelvetica18.java | 14 +-
.../opengl/util/gl2/GLUTBitmapTimesRoman10.java | 14 +-
.../opengl/util/gl2/GLUTBitmapTimesRoman24.java | 14 +-
.../opengl/util/gl2/GLUTStrokeMonoRoman.java | 14 +-
.../jogamp/opengl/util/gl2/GLUTStrokeRoman.java | 14 +-
.../com/jogamp/opengl/util/gl2/StrokeCharRec.java | 18 +-
.../com/jogamp/opengl/util/gl2/StrokeFontRec.java | 18 +-
.../com/jogamp/opengl/util/gl2/StrokeRec.java | 20 +-
.../com/jogamp/opengl/util/glsl/ShaderCode.java | 208 +++---
.../com/jogamp/opengl/util/glsl/ShaderProgram.java | 42 +-
.../com/jogamp/opengl/util/glsl/ShaderState.java | 232 +++---
.../com/jogamp/opengl/util/glsl/ShaderUtil.java | 54 +-
.../opengl/util/glsl/fixedfunc/FixedFuncUtil.java | 12 +-
.../util/glsl/fixedfunc/ShaderSelectionMode.java | 18 +-
.../jogamp/opengl/util/glsl/sdk/CompileShader.java | 4 +-
.../opengl/util/packrect/BackingStoreManager.java | 14 +-
.../com/jogamp/opengl/util/packrect/Level.java | 16 +-
.../com/jogamp/opengl/util/packrect/LevelSet.java | 16 +-
.../com/jogamp/opengl/util/packrect/Rect.java | 16 +-
.../jogamp/opengl/util/packrect/RectVisitor.java | 14 +-
.../opengl/util/packrect/RectanglePacker.java | 16 +-
.../com/jogamp/opengl/util/texture/Texture.java | 86 +--
.../jogamp/opengl/util/texture/TextureCoords.java | 16 +-
.../jogamp/opengl/util/texture/TextureData.java | 94 +--
.../com/jogamp/opengl/util/texture/TextureIO.java | 74 +-
.../opengl/util/texture/TextureSequence.java | 120 ++--
.../jogamp/opengl/util/texture/TextureState.java | 52 +-
.../opengl/util/texture/awt/AWTTextureData.java | 28 +-
.../opengl/util/texture/awt/AWTTextureIO.java | 18 +-
.../jogamp/opengl/util/texture/spi/DDSImage.java | 22 +-
.../jogamp/opengl/util/texture/spi/JPEGImage.java | 40 +-
.../opengl/util/texture/spi/LEDataInputStream.java | 22 +-
.../util/texture/spi/LEDataOutputStream.java | 14 +-
.../util/texture/spi/NetPbmTextureWriter.java | 36 +-
.../jogamp/opengl/util/texture/spi/PNGImage.java | 66 +-
.../jogamp/opengl/util/texture/spi/SGIImage.java | 38 +-
.../jogamp/opengl/util/texture/spi/TGAImage.java | 34 +-
.../opengl/util/texture/spi/TextureProvider.java | 14 +-
.../opengl/util/texture/spi/TextureWriter.java | 14 +-
.../util/texture/spi/awt/IIOTextureProvider.java | 14 +-
.../util/texture/spi/awt/IIOTextureWriter.java | 16 +-
src/jogl/classes/javax/media/opengl/DebugGL2.java | 2 +-
src/jogl/classes/javax/media/opengl/DebugGL3.java | 2 +-
.../classes/javax/media/opengl/DebugGL3bc.java | 2 +-
src/jogl/classes/javax/media/opengl/DebugGL4.java | 2 +-
.../classes/javax/media/opengl/DebugGLES2.java | 2 +-
.../media/opengl/DefaultGLCapabilitiesChooser.java | 32 +-
.../classes/javax/media/opengl/FPSCounter.java | 32 +-
.../javax/media/opengl/GLAnimatorControl.java | 16 +-
.../classes/javax/media/opengl/GLArrayData.java | 20 +-
.../classes/javax/media/opengl/GLAutoDrawable.java | 120 ++--
src/jogl/classes/javax/media/opengl/GLBase.java | 108 +--
.../classes/javax/media/opengl/GLCapabilities.java | 16 +-
.../javax/media/opengl/GLCapabilitiesChooser.java | 16 +-
.../media/opengl/GLCapabilitiesImmutable.java | 10 +-
src/jogl/classes/javax/media/opengl/GLContext.java | 320 ++++-----
.../javax/media/opengl/GLDebugListener.java | 8 +-
.../classes/javax/media/opengl/GLDebugMessage.java | 114 +--
.../classes/javax/media/opengl/GLDrawable.java | 22 +-
.../javax/media/opengl/GLDrawableFactory.java | 152 ++--
.../javax/media/opengl/GLEventListener.java | 22 +-
.../classes/javax/media/opengl/GLException.java | 14 +-
.../classes/javax/media/opengl/GLFBODrawable.java | 76 +-
.../media/opengl/GLOffscreenAutoDrawable.java | 20 +-
src/jogl/classes/javax/media/opengl/GLPbuffer.java | 4 +-
.../javax/media/opengl/GLPipelineFactory.java | 22 +-
src/jogl/classes/javax/media/opengl/GLProfile.java | 282 ++++----
.../classes/javax/media/opengl/GLRunnable.java | 20 +-
.../classes/javax/media/opengl/GLRunnable2.java | 14 +-
.../classes/javax/media/opengl/GLUniformData.java | 14 +-
src/jogl/classes/javax/media/opengl/Threading.java | 52 +-
src/jogl/classes/javax/media/opengl/TraceGL2.java | 2 +-
src/jogl/classes/javax/media/opengl/TraceGL3.java | 2 +-
.../classes/javax/media/opengl/TraceGL3bc.java | 2 +-
src/jogl/classes/javax/media/opengl/TraceGL4.java | 2 +-
.../classes/javax/media/opengl/TraceGLES2.java | 2 +-
.../javax/media/opengl/awt/ComponentEvents.java | 14 +-
.../classes/javax/media/opengl/awt/GLCanvas.java | 104 +--
.../classes/javax/media/opengl/awt/GLJPanel.java | 192 ++---
.../javax/media/opengl/fixedfunc/GLMatrixFunc.java | 18 +-
.../media/opengl/fixedfunc/GLPointerFunc.java | 2 +-
.../media/opengl/fixedfunc/GLPointerFuncUtil.java | 10 +-
.../jogamp/graph/curve/opengl/RegionFactory.java | 20 +-
.../graph/curve/opengl/RegionRendererImpl01.java | 24 +-
.../jogamp/graph/curve/opengl/RenderStateImpl.java | 14 +-
.../graph/curve/opengl/TextRendererImpl01.java | 26 +-
.../jogamp/graph/curve/opengl/VBORegion2PES2.java | 178 ++---
.../jogamp/graph/curve/opengl/VBORegionSPES2.java | 34 +-
.../graph/curve/opengl/shader/AttributeNames.java | 12 +-
.../graph/curve/opengl/shader/UniformNames.java | 2 +-
.../jogamp/graph/curve/tess/CDTriangulator2D.java | 30 +-
.../jogamp/graph/curve/tess/GraphOutline.java | 10 +-
.../jogamp/graph/curve/tess/GraphVertex.java | 12 +-
.../classes/jogamp/graph/curve/tess/HEdge.java | 12 +-
src/jogl/classes/jogamp/graph/curve/tess/Loop.java | 30 +-
.../jogamp/graph/curve/text/GlyphShape.java | 20 +-
.../jogamp/graph/curve/text/GlyphString.java | 58 +-
src/jogl/classes/jogamp/graph/font/FontInt.java | 2 +-
.../classes/jogamp/graph/font/JavaFontLoader.java | 46 +-
.../jogamp/graph/font/UbuntuFontLoader.java | 36 +-
.../jogamp/graph/font/typecast/TypecastFont.java | 56 +-
.../font/typecast/TypecastFontConstructor.java | 10 +-
.../jogamp/graph/font/typecast/TypecastGlyph.java | 88 +--
.../graph/font/typecast/TypecastHMetrics.java | 14 +-
.../graph/font/typecast/TypecastRenderer.java | 26 +-
.../graph/font/typecast/ot/Disassembler.java | 8 +-
.../jogamp/graph/font/typecast/ot/Fixed.java | 4 +-
.../jogamp/graph/font/typecast/ot/Mnemonic.java | 8 +-
.../jogamp/graph/font/typecast/ot/OTFont.java | 36 +-
.../graph/font/typecast/ot/OTFontCollection.java | 4 +-
.../jogamp/graph/font/typecast/ot/OTGlyph.java | 8 +-
.../graph/font/typecast/ot/mac/ResourceData.java | 2 +-
.../graph/font/typecast/ot/mac/ResourceFile.java | 10 +-
.../graph/font/typecast/ot/mac/ResourceHeader.java | 6 +-
.../graph/font/typecast/ot/mac/ResourceMap.java | 10 +-
.../font/typecast/ot/mac/ResourceReference.java | 12 +-
.../graph/font/typecast/ot/mac/ResourceType.java | 10 +-
.../graph/font/typecast/ot/table/BaseTable.java | 98 +--
.../graph/font/typecast/ot/table/CffTable.java | 122 ++--
.../graph/font/typecast/ot/table/Charstring.java | 2 +-
.../font/typecast/ot/table/CharstringType2.java | 18 +-
.../graph/font/typecast/ot/table/ClassDef.java | 8 +-
.../font/typecast/ot/table/ClassDefFormat1.java | 8 +-
.../font/typecast/ot/table/ClassDefFormat2.java | 8 +-
.../graph/font/typecast/ot/table/CmapFormat.java | 14 +-
.../graph/font/typecast/ot/table/CmapFormat0.java | 2 +-
.../graph/font/typecast/ot/table/CmapFormat2.java | 28 +-
.../graph/font/typecast/ot/table/CmapFormat4.java | 4 +-
.../graph/font/typecast/ot/table/CmapFormat6.java | 4 +-
.../font/typecast/ot/table/CmapFormatUnknown.java | 6 +-
.../font/typecast/ot/table/CmapIndexEntry.java | 2 +-
.../graph/font/typecast/ot/table/CmapTable.java | 10 +-
.../graph/font/typecast/ot/table/Coverage.java | 2 +-
.../graph/font/typecast/ot/table/CvtTable.java | 12 +-
.../graph/font/typecast/ot/table/Device.java | 8 +-
.../font/typecast/ot/table/DirectoryEntry.java | 4 +-
.../graph/font/typecast/ot/table/DsigEntry.java | 14 +-
.../graph/font/typecast/ot/table/DsigTable.java | 12 +-
.../graph/font/typecast/ot/table/FeatureList.java | 8 +-
.../font/typecast/ot/table/FeatureRecord.java | 2 +-
.../graph/font/typecast/ot/table/FpgmTable.java | 12 +-
.../graph/font/typecast/ot/table/GaspRange.java | 12 +-
.../graph/font/typecast/ot/table/GaspTable.java | 14 +-
.../typecast/ot/table/GlyfCompositeDescript.java | 2 +-
.../graph/font/typecast/ot/table/GlyfDescript.java | 2 +-
.../font/typecast/ot/table/GlyfSimpleDescript.java | 4 +-
.../graph/font/typecast/ot/table/GlyfTable.java | 6 +-
.../font/typecast/ot/table/GlyphDescription.java | 24 +-
.../graph/font/typecast/ot/table/GposTable.java | 4 +-
.../graph/font/typecast/ot/table/GsubTable.java | 20 +-
.../graph/font/typecast/ot/table/HdmxTable.java | 20 +-
.../graph/font/typecast/ot/table/HeadTable.java | 4 +-
.../graph/font/typecast/ot/table/HheaTable.java | 12 +-
.../jogamp/graph/font/typecast/ot/table/ID.java | 4 +-
.../graph/font/typecast/ot/table/KernSubtable.java | 12 +-
.../typecast/ot/table/KernSubtableFormat0.java | 10 +-
.../typecast/ot/table/KernSubtableFormat2.java | 8 +-
.../graph/font/typecast/ot/table/KernTable.java | 14 +-
.../graph/font/typecast/ot/table/KerningPair.java | 8 +-
.../graph/font/typecast/ot/table/LangSys.java | 10 +-
.../font/typecast/ot/table/LangSysRecord.java | 2 +-
.../graph/font/typecast/ot/table/Ligature.java | 4 +-
.../typecast/ot/table/LigatureSubstFormat1.java | 2 +-
.../graph/font/typecast/ot/table/LocaTable.java | 10 +-
.../graph/font/typecast/ot/table/Lookup.java | 2 +-
.../graph/font/typecast/ot/table/LookupList.java | 8 +-
.../typecast/ot/table/LookupSubtableFactory.java | 4 +-
.../graph/font/typecast/ot/table/LtshTable.java | 16 +-
.../graph/font/typecast/ot/table/MaxpTable.java | 14 +-
.../graph/font/typecast/ot/table/NameRecord.java | 18 +-
.../graph/font/typecast/ot/table/NameTable.java | 14 +-
.../graph/font/typecast/ot/table/Os2Table.java | 14 +-
.../graph/font/typecast/ot/table/Panose.java | 26 +-
.../graph/font/typecast/ot/table/PcltTable.java | 14 +-
.../graph/font/typecast/ot/table/PostTable.java | 18 +-
.../graph/font/typecast/ot/table/PrepTable.java | 12 +-
.../graph/font/typecast/ot/table/Program.java | 8 +-
.../graph/font/typecast/ot/table/RangeRecord.java | 2 +-
.../graph/font/typecast/ot/table/Script.java | 6 +-
.../graph/font/typecast/ot/table/ScriptList.java | 12 +-
.../graph/font/typecast/ot/table/ScriptRecord.java | 4 +-
.../font/typecast/ot/table/SignatureBlock.java | 10 +-
.../graph/font/typecast/ot/table/SingleSubst.java | 2 +-
.../font/typecast/ot/table/SingleSubstFormat1.java | 2 +-
.../font/typecast/ot/table/SingleSubstFormat2.java | 2 +-
.../graph/font/typecast/ot/table/TTCHeader.java | 12 +-
.../jogamp/graph/font/typecast/ot/table/Table.java | 12 +-
.../font/typecast/ot/table/TableDirectory.java | 2 +-
.../font/typecast/ot/table/TableException.java | 6 +-
.../graph/font/typecast/ot/table/TableFactory.java | 10 +-
.../graph/font/typecast/ot/table/VdmxTable.java | 40 +-
.../graph/font/typecast/ot/table/VheaTable.java | 2 +-
.../graph/font/typecast/t2/T2Interpreter.java | 146 ++--
.../graph/font/typecast/tt/engine/Interpreter.java | 4 +-
.../jogamp/graph/geom/plane/AffineTransform.java | 50 +-
.../classes/jogamp/graph/geom/plane/Crossing.java | 26 +-
.../classes/jogamp/graph/geom/plane/Path2D.java | 42 +-
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 +-
.../DelegatedUpstreamSurfaceHookMutableSize.java | 6 +-
...elegatedUpstreamSurfaceHookWithSurfaceSize.java | 8 +-
.../nativewindow/MutableGraphicsConfiguration.java | 4 +-
.../jogamp/nativewindow/NativeWindowVersion.java | 10 +-
.../UpstreamSurfaceHookMutableSize.java | 10 +-
.../nativewindow/awt/AWTGraphicsConfiguration.java | 26 +-
.../jogamp/nativewindow/awt/AWTGraphicsDevice.java | 14 +-
.../jogamp/nativewindow/awt/AWTGraphicsScreen.java | 14 +-
.../jogamp/nativewindow/awt/AWTPrintLifecycle.java | 26 +-
.../nativewindow/awt/AWTWindowClosingProtocol.java | 2 +-
.../nativewindow/awt/DirectDataBufferInt.java | 62 +-
.../com/jogamp/nativewindow/awt/JAWTWindow.java | 52 +-
.../jogamp/nativewindow/egl/EGLGraphicsDevice.java | 30 +-
.../nativewindow/macosx/MacOSXGraphicsDevice.java | 10 +-
.../com/jogamp/nativewindow/swt/SWTAccessor.java | 164 ++---
.../windows/WindowsGraphicsDevice.java | 12 +-
.../nativewindow/x11/X11GraphicsConfiguration.java | 16 +-
.../jogamp/nativewindow/x11/X11GraphicsDevice.java | 30 +-
.../jogamp/nativewindow/x11/X11GraphicsScreen.java | 12 +-
.../AbstractGraphicsConfiguration.java | 16 +-
.../media/nativewindow/AbstractGraphicsDevice.java | 46 +-
.../media/nativewindow/AbstractGraphicsScreen.java | 16 +-
.../javax/media/nativewindow/Capabilities.java | 46 +-
.../media/nativewindow/CapabilitiesChooser.java | 16 +-
.../media/nativewindow/CapabilitiesImmutable.java | 8 +-
.../nativewindow/DefaultCapabilitiesChooser.java | 24 +-
.../nativewindow/DefaultGraphicsConfiguration.java | 18 +-
.../media/nativewindow/DefaultGraphicsDevice.java | 34 +-
.../media/nativewindow/DefaultGraphicsScreen.java | 12 +-
.../nativewindow/GraphicsConfigurationFactory.java | 84 +--
.../javax/media/nativewindow/MutableSurface.java | 4 +-
.../javax/media/nativewindow/NativeSurface.java | 40 +-
.../media/nativewindow/NativeWindowException.java | 14 +-
.../media/nativewindow/NativeWindowFactory.java | 134 ++--
.../media/nativewindow/OffscreenLayerOption.java | 12 +-
.../media/nativewindow/OffscreenLayerSurface.java | 22 +-
.../javax/media/nativewindow/ProxySurface.java | 60 +-
.../media/nativewindow/SurfaceUpdatedListener.java | 12 +-
.../javax/media/nativewindow/ToolkitLock.java | 14 +-
.../media/nativewindow/UpstreamSurfaceHook.java | 18 +-
.../javax/media/nativewindow/VisualIDHolder.java | 36 +-
.../media/nativewindow/WindowClosingProtocol.java | 4 +-
.../javax/media/nativewindow/util/Dimension.java | 18 +-
.../nativewindow/util/DimensionImmutable.java | 4 +-
.../javax/media/nativewindow/util/Insets.java | 18 +-
.../media/nativewindow/util/InsetsImmutable.java | 4 +-
.../javax/media/nativewindow/util/Point.java | 8 +-
.../media/nativewindow/util/PointImmutable.java | 6 +-
.../javax/media/nativewindow/util/Rectangle.java | 28 +-
.../nativewindow/util/RectangleImmutable.java | 10 +-
.../javax/media/nativewindow/util/SurfaceSize.java | 18 +-
.../classes/jogamp/nativewindow/Debug.java | 16 +-
.../DefaultGraphicsConfigurationFactoryImpl.java | 10 +-
.../jogamp/nativewindow/GlobalToolkitLock.java | 14 +-
.../jogamp/nativewindow/NWJNILibLoader.java | 12 +-
.../nativewindow/NativeWindowFactoryImpl.java | 16 +-
.../jogamp/nativewindow/NullToolkitLock.java | 10 +-
.../jogamp/nativewindow/ProxySurfaceImpl.java | 42 +-
.../jogamp/nativewindow/ResourceToolkitLock.java | 8 +-
.../nativewindow/SharedResourceToolkitLock.java | 18 +-
.../jogamp/nativewindow/SurfaceUpdatedHelper.java | 22 +-
.../jogamp/nativewindow/ToolkitProperties.java | 20 +-
.../jogamp/nativewindow/WrappedSurface.java | 10 +-
.../classes/jogamp/nativewindow/awt/AWTMisc.java | 20 +-
.../jogamp/nativewindow/jawt/JAWTJNILibLoader.java | 24 +-
.../classes/jogamp/nativewindow/jawt/JAWTUtil.java | 112 +--
.../nativewindow/jawt/JAWT_PlatformInfo.java | 14 +-
.../nativewindow/jawt/macosx/MacOSXJAWTWindow.java | 82 +--
.../jawt/windows/Win32SunJDKReflection.java | 14 +-
.../jawt/windows/WindowsJAWTWindow.java | 16 +-
.../nativewindow/jawt/x11/X11JAWTWindow.java | 18 +-
.../nativewindow/jawt/x11/X11SunJDKReflection.java | 14 +-
.../macosx/OSXDummyUpstreamSurfaceHook.java | 14 +-
.../jogamp/nativewindow/macosx/OSXUtil.java | 94 +--
.../windows/GDIDummyUpstreamSurfaceHook.java | 18 +-
.../jogamp/nativewindow/windows/GDISurface.java | 14 +-
.../jogamp/nativewindow/windows/GDIUtil.java | 36 +-
.../nativewindow/windows/RegisteredClass.java | 2 +-
.../windows/RegisteredClassFactory.java | 16 +-
.../x11/X11DummyUpstreamSurfaceHook.java | 14 +-
.../x11/X11GraphicsConfigurationFactory.java | 16 +-
.../classes/jogamp/nativewindow/x11/X11Util.java | 94 +--
.../awt/X11AWTGraphicsConfigurationFactory.java | 36 +-
src/newt/classes/com/jogamp/newt/Display.java | 32 +-
.../classes/com/jogamp/newt/MonitorDevice.java | 46 +-
src/newt/classes/com/jogamp/newt/MonitorMode.java | 84 +--
src/newt/classes/com/jogamp/newt/NewtFactory.java | 24 +-
src/newt/classes/com/jogamp/newt/NewtVersion.java | 10 +-
src/newt/classes/com/jogamp/newt/Screen.java | 34 +-
src/newt/classes/com/jogamp/newt/Window.java | 32 +-
.../classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 158 ++---
.../jogamp/newt/awt/applet/JOGLNewtApplet1Run.java | 24 +-
.../jogamp/newt/awt/applet/JOGLNewtAppletBase.java | 22 +-
.../jogamp/newt/event/DoubleTapScrollGesture.java | 66 +-
.../com/jogamp/newt/event/GestureHandler.java | 60 +-
.../classes/com/jogamp/newt/event/InputEvent.java | 56 +-
.../classes/com/jogamp/newt/event/KeyAdapter.java | 10 +-
.../classes/com/jogamp/newt/event/KeyEvent.java | 256 +++----
.../classes/com/jogamp/newt/event/KeyListener.java | 22 +-
.../com/jogamp/newt/event/MonitorEvent.java | 12 +-
.../com/jogamp/newt/event/MouseAdapter.java | 10 +-
.../classes/com/jogamp/newt/event/MouseEvent.java | 164 ++---
.../com/jogamp/newt/event/MouseListener.java | 20 +-
.../classes/com/jogamp/newt/event/NEWTEvent.java | 30 +-
.../com/jogamp/newt/event/NEWTEventConsumer.java | 14 +-
.../com/jogamp/newt/event/NEWTEventFiFo.java | 10 +-
.../com/jogamp/newt/event/NEWTEventListener.java | 12 +-
.../classes/com/jogamp/newt/event/OutputEvent.java | 2 +-
.../com/jogamp/newt/event/PinchToZoomGesture.java | 48 +-
.../com/jogamp/newt/event/TraceKeyAdapter.java | 10 +-
.../com/jogamp/newt/event/TraceMouseAdapter.java | 10 +-
.../com/jogamp/newt/event/TraceWindowAdapter.java | 10 +-
.../com/jogamp/newt/event/WindowAdapter.java | 10 +-
.../classes/com/jogamp/newt/event/WindowEvent.java | 16 +-
.../com/jogamp/newt/event/WindowListener.java | 18 +-
.../com/jogamp/newt/event/WindowUpdateEvent.java | 10 +-
.../com/jogamp/newt/event/awt/AWTAdapter.java | 36 +-
.../com/jogamp/newt/event/awt/AWTKeyAdapter.java | 12 +-
.../com/jogamp/newt/event/awt/AWTMouseAdapter.java | 12 +-
.../jogamp/newt/event/awt/AWTWindowAdapter.java | 24 +-
.../classes/com/jogamp/newt/opengl/GLWindow.java | 38 +-
.../classes/com/jogamp/newt/swt/NewtCanvasSWT.java | 130 ++--
src/newt/classes/com/jogamp/newt/util/EDTUtil.java | 30 +-
.../classes/com/jogamp/newt/util/MainThread.java | 90 +--
.../com/jogamp/newt/util/MonitorModeUtil.java | 18 +-
src/newt/classes/jogamp/newt/Debug.java | 18 +-
src/newt/classes/jogamp/newt/DefaultEDTUtil.java | 36 +-
src/newt/classes/jogamp/newt/DisplayImpl.java | 66 +-
.../classes/jogamp/newt/MonitorDeviceImpl.java | 28 +-
src/newt/classes/jogamp/newt/MonitorModeProps.java | 44 +-
src/newt/classes/jogamp/newt/NEWTJNILibLoader.java | 16 +-
src/newt/classes/jogamp/newt/OffscreenWindow.java | 28 +-
src/newt/classes/jogamp/newt/ScreenImpl.java | 98 +--
.../classes/jogamp/newt/ScreenMonitorState.java | 18 +-
src/newt/classes/jogamp/newt/WindowImpl.java | 554 +++++++--------
.../classes/jogamp/newt/awt/NewtFactoryAWT.java | 16 +-
.../jogamp/newt/awt/event/AWTNewtEventFactory.java | 74 +-
.../newt/awt/event/AWTParentWindowAdapter.java | 20 +-
.../jogamp/newt/driver/DriverClearFocus.java | 6 +-
.../jogamp/newt/driver/DriverUpdatePosition.java | 8 +-
.../classes/jogamp/newt/driver/awt/AWTCanvas.java | 40 +-
.../classes/jogamp/newt/driver/awt/AWTEDTUtil.java | 32 +-
.../jogamp/newt/driver/awt/DisplayDriver.java | 16 +-
.../jogamp/newt/driver/awt/ScreenDriver.java | 28 +-
.../jogamp/newt/driver/awt/WindowDriver.java | 50 +-
.../jogamp/newt/driver/bcm/egl/DisplayDriver.java | 12 +-
.../jogamp/newt/driver/bcm/egl/ScreenDriver.java | 20 +-
.../jogamp/newt/driver/bcm/egl/WindowDriver.java | 22 +-
.../newt/driver/bcm/vc/iv/DisplayDriver.java | 10 +-
.../jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java | 22 +-
.../jogamp/newt/driver/bcm/vc/iv/WindowDriver.java | 30 +-
.../newt/driver/intel/gdl/DisplayDriver.java | 12 +-
.../jogamp/newt/driver/intel/gdl/ScreenDriver.java | 22 +-
.../jogamp/newt/driver/intel/gdl/WindowDriver.java | 18 +-
.../jogamp/newt/driver/kd/DisplayDriver.java | 12 +-
.../jogamp/newt/driver/kd/ScreenDriver.java | 26 +-
.../jogamp/newt/driver/kd/WindowDriver.java | 22 +-
.../newt/driver/linux/LinuxEventDeviceTracker.java | 16 +-
.../newt/driver/linux/LinuxMouseTracker.java | 46 +-
.../jogamp/newt/driver/macosx/DisplayDriver.java | 18 +-
.../jogamp/newt/driver/macosx/MacKeyUtil.java | 38 +-
.../jogamp/newt/driver/macosx/ScreenDriver.java | 32 +-
.../jogamp/newt/driver/macosx/WindowDriver.java | 126 ++--
.../jogamp/newt/driver/windows/DisplayDriver.java | 18 +-
.../jogamp/newt/driver/windows/ScreenDriver.java | 28 +-
.../jogamp/newt/driver/windows/WindowDriver.java | 90 +--
.../jogamp/newt/driver/x11/DisplayDriver.java | 28 +-
src/newt/classes/jogamp/newt/driver/x11/RandR.java | 22 +-
.../classes/jogamp/newt/driver/x11/RandR11.java | 66 +-
.../classes/jogamp/newt/driver/x11/RandR13.java | 60 +-
.../jogamp/newt/driver/x11/ScreenDriver.java | 68 +-
.../jogamp/newt/driver/x11/WindowDriver.java | 92 +--
.../classes/jogamp/newt/event/NEWTEventTask.java | 10 +-
src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java | 46 +-
.../jogamp/newt/swt/event/SWTNewtEventFactory.java | 48 +-
643 files changed, 12269 insertions(+), 12269 deletions(-)
(limited to 'src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java')
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
index 2b51be164..83f5e4ebd 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2008 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
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
index 60972873e..0a502c123 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2008 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
@@ -344,7 +344,7 @@ public class Mixer {
e.printStackTrace();
}
}
-
+
if (directByteBufferConstructor != null) {
try {
return (ByteBuffer)
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
index c45430d23..01346553c 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2008 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
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
index b57bf1dc6..98a787478 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2008 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
@@ -151,7 +151,7 @@ public class Track {
// These are only for use by the Mixer
private float leftGain;
private float rightGain;
-
+
void setLeftGain(float leftGain) {
this.leftGain = leftGain;
}
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
index 1afdaf081..0726e5762 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2008 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
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
index b04f35230..8429fbcfd 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.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.
*/
@@ -67,7 +67,7 @@ public class BuildComposablePipeline {
* By extra command-line argument: prolog_xor_downstream.
*
* If true, either prolog (if exist) is called or downstream's method, but not both.
- * By default, both methods would be called.
+ * By default, both methods would be called.
*
*
Default: false
*/
@@ -81,7 +81,7 @@ public class BuildComposablePipeline {
*
Default: false
*/
public static final int GEN_GL_IDENTITY_BY_ASSIGNABLE_CLASS = 1 << 4;
-
+
int mode;
private String outputDir;
private String outputPackage;
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
index 5298cc357..a5a26d18f 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.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.
*/
@@ -68,7 +68,7 @@ import java.util.regex.Pattern;
*
*
*
- *
+ *
* #ifndef GL_XXXX
* GLAPI glFuncName()
* #endif GL_XXXX
@@ -78,7 +78,7 @@ import java.util.regex.Pattern;
* For example, if it parses the following data:
*
*
*
* It will associate
@@ -105,7 +105,7 @@ import java.util.regex.Pattern;
* */
public class BuildStaticGLInfo {
- // Handles function pointer
+ // Handles function pointer
protected static final int funcIdentifierGroup = 9;
protected static Pattern funcPattern =
Pattern.compile("^(GLAPI|GL_API|GL_APICALL|EGLAPI|extern)?(\\s*)((unsigned|const)\\s+)?(\\w+)(\\s+\\*\\s*|\\s*\\*\\s+|\\s+)?(GLAPIENTRY|GL_APIENTRY|APIENTRY|EGLAPIENTRY|WINAPI)?(\\s*)([ew]?gl\\w+)\\s?(\\(.*)");
@@ -119,7 +119,7 @@ public class BuildStaticGLInfo {
Pattern.compile("\\#(elif|else)(.*)");
protected static Pattern endifPattern =
Pattern.compile("\\#endif(.*)");
-
+
protected static final int defineIdentifierGroup = 1;
protected static Pattern definePattern =
Pattern.compile("\\#define ([CEW]?GL[XU]?_[A-Za-z0-9_]+)\\s*([A-Za-z0-9_]+)(.*)");
@@ -203,7 +203,7 @@ public class BuildStaticGLInfo {
Matcher m = null;
int block = 0;
while ((line = reader.readLine()) != null) {
- int type = 0; // 1-define, 2-function
+ int type = 0; // 1-define, 2-function
if ( 0 < block ) { // inside a #ifndef GL_XXX block and matching a function, if block > 0
String identifier = null;
if( 2 >= block ) { // not within sub-blocks > 2, i.e. further typedefs
@@ -216,9 +216,9 @@ public class BuildStaticGLInfo {
}
}
if ( identifier != null &&
- activeAssociation != null &&
- !identifier.equals(activeAssociation) // Handles #ifndef GL_... #define GL_...
- )
+ activeAssociation != null &&
+ !identifier.equals(activeAssociation) // Handles #ifndef GL_... #define GL_...
+ )
{
addAssociation(identifier, activeAssociation);
if (DEBUG) {
@@ -243,7 +243,7 @@ public class BuildStaticGLInfo {
if (DEBUG) {
System.err.println("<"+block+"> END ASSOCIATION BLOCK: <" + activeAssociation + " <-> " + comment + ">");
}
- activeAssociation = null;
+ activeAssociation = null;
} else {
if (DEBUG) {
System.err.println("<"+block+"> END IF BLOCK: <" + comment + ">");
@@ -251,7 +251,7 @@ public class BuildStaticGLInfo {
}
}
}
- } else if ((m = associationPattern.matcher(line)).matches()) {
+ } else if ((m = associationPattern.matcher(line)).matches()) {
// found a new #ifndef GL_XXX block
activeAssociation = m.group(1).trim();
block++;
@@ -387,7 +387,7 @@ public class BuildStaticGLInfo {
declarationToExtensionMap.put(identifier, extensions);
}
extensions.add(association);
-
+
Set identifiers = extensionToDeclarationMap.get(association);
if (identifiers == null) {
identifiers = new HashSet();
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
index a00b19abc..f1a32fa9c 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003-2005 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.
*/
@@ -241,7 +241,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
}
}
if( ignoredExtension ) {
- ignoredExtension = !shouldForceExtension( symbol, true, symbol );
+ ignoredExtension = !shouldForceExtension( symbol, true, symbol );
if( ignoredExtension ) {
final Set origSymbols = getRenamedJavaSymbols( symbol );
if(null != origSymbols) {
@@ -251,7 +251,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
break;
}
}
- }
+ }
}
}
if( ignoredExtension ) {
@@ -274,7 +274,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
}
return false;
}
-
+
public boolean shouldForceExtension(final String symbol, final boolean criteria, final String renamedSymbol) {
if (criteria && glInfo != null) {
final Set extensionNames = glInfo.getExtension(symbol);
@@ -292,7 +292,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
}
return true;
}
- }
+ }
}
}
return false;
@@ -343,9 +343,9 @@ public class GLConfiguration extends ProcAddressConfiguration {
public boolean isBufferObjectFunction(String name) {
return (getBufferObjectKind(name) != null);
}
-
- public boolean isBufferObjectOnly(String name) {
- return bufferObjectOnly.contains(name);
+
+ public boolean isBufferObjectOnly(String name) {
+ return bufferObjectOnly.contains(name);
}
/** Parses any GL headers specified in the configuration file for
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
index fa95049cc..1af632682 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003-2005 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.
*/
@@ -125,7 +125,7 @@ public class GLEmitter extends ProcAddressEmitter {
}
if(JavaConfiguration.DEBUG_RENAMES) {
System.err.println("RenameExtensionIntoCore: "+extension+" END>");
- }
+ }
}
}
@@ -279,7 +279,7 @@ public class GLEmitter extends ProcAddressEmitter {
int j=0;
while( j < bindings.size() ) {
final MethodBinding cur = bindings.get(j);
-
+
// Some of these routines (glBitmap) take strongly-typed
// primitive pointers as arguments which are expanded into
// non-void* arguments
@@ -306,7 +306,7 @@ public class GLEmitter extends ProcAddressEmitter {
// Now need to flag this MethodBinding so that we generate the
// correct flags in the emitters later
bufferObjectMethodBindings.put(result, result);
-
+
if( bufferObjectOnly ) {
bindings.remove(j);
} else {
@@ -397,7 +397,7 @@ public class GLEmitter extends ProcAddressEmitter {
}
private int addExtensionListOfAliasedSymbols2Buffer(BuildStaticGLInfo glInfo, StringBuilder buf, String sep1, String sep2, String name, Collection exclude) {
int num = 0;
- if(null != name) {
+ if(null != name) {
num += addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, name); // extensions of given name
boolean needsSep2 = 0 origNames = cfg.getRenamedJavaSymbols(name);
@@ -406,7 +406,7 @@ public class GLEmitter extends ProcAddressEmitter {
if(!exclude.contains(origName)) {
if (needsSep2) {
buf.append(sep2); // diff-name seperator
- }
+ }
int num2 = addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, origName); // extensions of orig-name
needsSep2 = num col) {
BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
if (null == glInfo) {
@@ -469,16 +469,16 @@ public class GLEmitter extends ProcAddressEmitter {
/**
* {@inheritDoc}
- */
+ */
@Override
protected void endProcAddressTable() throws Exception {
PrintWriter w = tableWriter;
-
+
w.println(" @Override");
w.println(" protected boolean isFunctionAvailableImpl(String functionNameUsr) throws IllegalArgumentException {");
w.println(" final String functionNameBase = "+GLNameResolver.class.getName()+".normalizeVEN(com.jogamp.gluegen.runtime.opengl.GLNameResolver.normalizeARB(functionNameUsr, true), true);");
w.println(" final String addressFieldNameBase = \"" + PROCADDRESS_VAR_PREFIX + "\" + functionNameBase;");
- w.println(" final int funcNamePermNum = "+GLNameResolver.class.getName()+".getFuncNamePermutationNumber(functionNameBase);");
+ w.println(" final int funcNamePermNum = "+GLNameResolver.class.getName()+".getFuncNamePermutationNumber(functionNameBase);");
w.println(" final java.lang.reflect.Field addressField = java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {");
w.println(" public final java.lang.reflect.Field run() {");
w.println(" java.lang.reflect.Field addressField = null;");
@@ -510,7 +510,7 @@ public class GLEmitter extends ProcAddressEmitter {
w.println(" \"function\", e);");
w.println(" }");
w.println(" }");
-
+
w.println(" @Override");
w.println(" public long getAddressFor(String functionNameUsr) throws SecurityException, IllegalArgumentException {");
w.println(" SecurityUtil.checkAllLinkPermission();");
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
index fdfaee8a6..389d35f99 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003-2005 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.
*/
@@ -111,7 +111,7 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
writer.print(" ");
writer.print(funcSym.getType().toString(symbolRenamed, tagNativeBinding));
writer.print(" ");
-
+
newComment.append(" Part of ");
if (0 == glEmitter.addExtensionsOfSymbols2Buffer(newComment, ", ", "; ", symbolRenamed, binding.getAliasedNames())) {
if (glEmitter.getGLConfig().getAllowNonGLExtensions()) {
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
index e3e7cb970..b98f17117 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
@@ -55,13 +55,13 @@ import org.apache.tools.ant.util.JavaEnvUtils;
/**
*
An ANT {@link org.apache.tools.ant.Task}
* for using {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo}.
- *
+ *
*
Usage:
*
- <staticglgen package="[generated files package]"
+ <staticglgen package="[generated files package]"
headers="[file pattern of GL headers]"
outputdir="[directory to output the generated files]" />
- *
+ *
*
* @author Rob Grzywinski rgrzywinski@yahoo.com
*/
@@ -72,7 +72,7 @@ public class StaticGLGenTask extends Task
*
The {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo} classname.
Create and add the VM and classname to {@link org.apache.tools.ant.types.CommandlineJava}.
@@ -104,7 +104,7 @@ public class StaticGLGenTask extends Task
{
// create the CommandlineJava that will be used to call BuildStaticGLInfo
glgenCommandline = new CommandlineJava();
-
+
// set the VM and classname in the commandline
glgenCommandline.setVm(JavaEnvUtils.getJreExecutable("java"));
glgenCommandline.setClassname(GL_GEN);
@@ -114,7 +114,7 @@ public class StaticGLGenTask extends Task
// ANT getters and setters
/**
*
Set the package name for the generated files. This is called by ANT.
- *
+ *
* @param packageName the name of the package for the generated files
*/
public void setPackage(String packageName)
@@ -125,12 +125,12 @@ public class StaticGLGenTask extends Task
/**
*
Set the output directory. This is called by ANT.
- *
+ *
* @param directory the output directory
*/
public void setOutputDir(String directory)
{
- log( ("Setting output directory to: " + directory),
+ log( ("Setting output directory to: " + directory),
Project.MSG_VERBOSE);
this.outputDirectory = directory;
}
@@ -138,7 +138,7 @@ public class StaticGLGenTask extends Task
/**
*
Add a header file to the list. This is called by ANT for a nested
* element.
- *
+ *
* @return {@link org.apache.tools.ant.types.PatternSet.NameEntry}
*/
public PatternSet.NameEntry createHeader()
@@ -149,7 +149,7 @@ public class StaticGLGenTask extends Task
/**
*
Add a header file to the list. This is called by ANT for a nested
* element.
- *
+ *
* @return {@link org.apache.tools.ant.types.PatternSet.NameEntry}
*/
public PatternSet.NameEntry createHeadersFile()
@@ -171,7 +171,7 @@ public class StaticGLGenTask extends Task
/**
*
Add an optional classpath that defines the location of {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo}
* and BuildStaticGLInfo's dependencies.
- *
+ *
* @returns {@link org.apache.tools.ant.types.Path}
*/
public Path createClasspath()
@@ -183,23 +183,23 @@ public class StaticGLGenTask extends Task
/**
*
Run the task. This involves validating the set attributes, creating
* the command line to be executed and finally executing the command.
- *
+ *
* @see org.apache.tools.ant.Task#execute()
*/
- public void execute()
- throws BuildException
+ public void execute()
+ throws BuildException
{
// validate that all of the required attributes have been set
validateAttributes();
-
+
// TODO: add logic to determine if the generated file needs to be
// regenerated
-
+
// add the attributes to the CommandlineJava
addAttributes();
log(glgenCommandline.describeCommand(), Project.MSG_VERBOSE);
-
+
// execute the command and throw on error
final int error = execute(glgenCommandline.getCommandline());
if(error == 1)
@@ -208,11 +208,11 @@ public class StaticGLGenTask extends Task
/**
*
Ensure that the user specified all required arguments.
- *
- * @throws BuildException if there are required arguments that are not
+ *
+ * @throws BuildException if there are required arguments that are not
* present or not valid
*/
- private void validateAttributes()
+ private void validateAttributes()
throws BuildException
{
// validate that the package name is set
@@ -223,29 +223,29 @@ public class StaticGLGenTask extends Task
// TODO: switch to file and ensure that it exists
if(!isValid(outputDirectory))
throw new BuildException("Invalid output directory name: " + outputDirectory);
-
+
// TODO: validate that there are headers set
}
/**
*
Is the specified string valid? A valid string is non-null
* and has a non-zero length.
- *
+ *
* @param string the string to be tested for validity
* @return true if the string is valid. false
- * otherwise.
+ * otherwise.
*/
private boolean isValid(String string)
{
// check for null
if(string == null)
return false;
-
+
// ensure that the string has a non-zero length
// NOTE: must trim() to remove leading and trailing whitespace
if(string.trim().length() < 1)
return false;
-
+
// the string is valid
return true;
}
@@ -258,10 +258,10 @@ public class StaticGLGenTask extends Task
{
// add the package name
glgenCommandline.createArgument().setValue(packageName);
-
+
// add the output directory name
glgenCommandline.createArgument().setValue(outputDirectory);
-
+
// add the header -files- from the FileSet
headerSet.setDir(getProject().getBaseDir());
DirectoryScanner directoryScanner = headerSet.getDirectoryScanner(getProject());
@@ -272,25 +272,25 @@ public class StaticGLGenTask extends Task
}
}
- /**
- *
Execute {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo} in a
+ /**
+ *
Execute {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo} in a
* forked JVM.
- *
+ *
* @throws BuildException
*/
- private int execute(String[] command)
+ private int execute(String[] command)
throws BuildException
{
// create the object that will perform the command execution
Execute execute = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
- Project.MSG_WARN),
+ Project.MSG_WARN),
null);
-
+
// set the project and command line
execute.setAntRun(project);
execute.setCommandline(command);
execute.setWorkingDirectory( project.getBaseDir() );
-
+
// execute the command
try
{
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
index adb1c2ae0..4ac9ae3f3 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.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.
*/
@@ -55,8 +55,8 @@ import java.util.Set;
/**
* Emitter producing NativeSignature attributes.
- *
- * Review: This Package/Class is not used and subject to be deleted.
+ *
+ * Review: This Package/Class is not used and subject to be deleted.
*/
public class NativeSignatureEmitter extends GLEmitter {
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
index e98478b6e..a17657382 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.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.
*/
@@ -182,14 +182,14 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
// Always emit outgoing "this" argument
writer.print("long ");
- writer.print(javaThisArgumentName());
+ writer.print(javaThisArgumentName());
++numEmitted;
needComma = true;
}
for (int i = 0; i < binding.getNumArguments(); i++) {
JavaType type = binding.getJavaArgumentType(i);
- if (type.isVoid()) {
+ if (type.isVoid()) {
// Make sure this is the only param to the method; if it isn't,
// there's something wrong with our parsing of the headers.
if (binding.getNumArguments() != 1) {
@@ -198,7 +198,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
"multi-argument function \"" + binding + "\"");
}
continue;
- }
+ }
if (type.isJNIEnv() || binding.isArgumentThisPointer(i)) {
// Don't need to expose these at the Java level
@@ -229,7 +229,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
if (type.isNIOBuffer()) {
writer.print(", int " + byteOffsetArgName(i));
} else if (type.isNIOBufferArray()) {
- writer.print(", int[] " +
+ writer.print(", int[] " +
byteOffsetArrayArgName(i));
}
}
@@ -246,7 +246,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
writer.print(" ");
JavaType returnType = binding.getJavaReturnType();
boolean needsResultAssignment = false;
-
+
if (!returnType.isVoid()) {
if (returnType.isCompoundTypeWrapper() ||
returnType.isNIOByteBuffer()) {
@@ -375,7 +375,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
// there's something wrong with our parsing of the headers.
assert(binding.getNumArguments() == 1);
continue;
- }
+ }
if (needComma) {
writer.print(", ");
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
index 92554776a..9b57a2f2d 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003-2005 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.
- *
+ *
*/
package com.jogamp.gluegen.runtime.opengl;
@@ -43,12 +43,12 @@ public class GLNameResolver {
//GL_XYZ : GL_XYZ, GL_GL2_XYZ, GL_ARB_XYZ, GL_OES_XYZ, GL_OML_XYZ
//
// Pass-1 Unify ARB extensions with the same value
- // Pass-2 Unify vendor extensions,
+ // Pass-2 Unify vendor extensions,
// if exist as an ARB extension with the same value.
// Pass-3 Emit
public static final String[] extensionsARB = { "ARB", "GL2", "OES", "KHR", "OML" };
- public static final String[] extensionsVEN = { "3DFX",
+ public static final String[] extensionsVEN = { "3DFX",
"AMD",
"ANGLE",
"ARM",
@@ -158,7 +158,7 @@ public class GLNameResolver {
return str;
}
public static final boolean isExtension(String str, boolean isGLFunc) {
- return isExtension(extensionsARB, str, isGLFunc) ||
+ return isExtension(extensionsARB, str, isGLFunc) ||
isExtension(extensionsVEN, str, isGLFunc);
}
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
index 9775de491..f8406075c 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.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.
*/
-
+
/*
* Created on Saturday, April 24 2010 16:44
*/
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
index a3749788b..cb2885e0f 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
@@ -42,13 +42,13 @@ import com.jogamp.opengl.math.geom.AABBox;
/** A Generic shape objects which is defined by a list of Outlines.
* This Shape can be transformed to Triangulations.
* The list of triangles generated are render-able by a Region object.
- * The triangulation produced by this Shape will define the
+ * The triangulation produced by this Shape will define the
* closed region defined by the outlines.
- *
+ *
* One or more OutlineShape Object can be associated to a region
* this is left as a high-level representation of the Objects. For
* optimizations, flexibility requirements for future features.
- *
+ *
*
- *
- * The above will create two outlines each with three vertices. By adding these two outlines to
+ *
+ * The above will create two outlines each with three vertices. By adding these two outlines to
* the OutlineShape, we are stating that the combination of the two outlines represent the shape.
*
- *
- * To specify that the shape is curved at a region, the on-curve flag should be set to false
+ *
+ * To specify that the shape is curved at a region, the on-curve flag should be set to false
* for the vertex that is in the middle of the curved region (if the curved region is defined by 3
* vertices (quadratic curve).
*
- * In case the curved region is defined by 4 or more vertices the middle vertices should both have
+ * In case the curved region is defined by 4 or more vertices the middle vertices should both have
* the on-curve flag set to false.
- *
+ *
* Example:
*
- *
- * The above snippet defines a cubic nurbs curve where (0,1 and 1,1)
+ *
+ * The above snippet defines a cubic nurbs curve where (0,1 and 1,1)
* do not belong to the final rendered shape.
- *
+ *
* Implementation Notes:
*
*
The first vertex of any outline belonging to the shape should be on-curve
*
Intersections between off-curved parts of the outline is not handled
*
- *
+ *
* @see Outline
* @see Region
*/
@@ -104,21 +104,21 @@ public class OutlineShape implements Comparable {
VerticesState(int state){
this.state = state;
}
- }
+ }
public static final int DIRTY_BOUNDS = 1 << 0;
private final Vertex.Factory extends Vertex> vertexFactory;
private VerticesState outlineState;
- /** The list of {@link Outline}s that are part of this
+ /** The list of {@link Outline}s that are part of this
* outline shape.
*/
private ArrayList outlines;
private AABBox bbox;
/** dirty bits DIRTY_BOUNDS */
- private int dirtyBits;
+ private int dirtyBits;
/** Create a new Outline based Shape
*/
@@ -128,7 +128,7 @@ public class OutlineShape implements Comparable {
this.outlines.add(new Outline());
this.outlineState = VerticesState.UNDEFINED;
this.bbox = new AABBox();
- this.dirtyBits = 0;
+ this.dirtyBits = 0;
}
/** Clears all data and reset all states as if this instance was newly created */
@@ -137,7 +137,7 @@ public class OutlineShape implements Comparable {
outlines.add(new Outline());
outlineState = VerticesState.UNDEFINED;
bbox.reset();
- dirtyBits = 0;
+ dirtyBits = 0;
}
/** Returns the associated vertex factory of this outline shape
@@ -149,10 +149,10 @@ public class OutlineShape implements Comparable {
return outlines.size();
}
- /** Add a new empty {@link Outline}
+ /** Add a new empty {@link Outline}
* to the end of this shape's outline list.
*
If the {@link #getLastOutline()} is empty already, no new one will be added.
- *
+ *
* After a call to this function all new vertices added
* will belong to the new outline
*/
@@ -164,26 +164,26 @@ public class OutlineShape implements Comparable {
/** Appends the {@link Outline} element to the end,
* ensuring a clean tail.
- *
+ *
*
A clean tail is ensured, no double empty Outlines are produced
* and a pre-existing empty outline will be replaced with the given one.
- *
+ *
* @param outline Outline object to be added
- * @throws NullPointerException if the {@link Outline} element is null
+ * @throws NullPointerException if the {@link Outline} element is null
*/
public void addOutline(Outline outline) throws NullPointerException {
addOutline(outlines.size(), outline);
}
/** Insert the {@link Outline} element at the given {@code position}.
- *
+ *
*
If the {@code position} indicates the end of this list,
* a clean tail is ensured, no double empty Outlines are produced
* and a pre-existing empty outline will be replaced with the given one.
- *
+ *
* @param position of the added Outline
* @param outline Outline object to be added
- * @throws NullPointerException if the {@link Outline} element is null
+ * @throws NullPointerException if the {@link Outline} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber())
*/
public void addOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException {
@@ -213,7 +213,7 @@ public class OutlineShape implements Comparable {
* using {@link #addOutline(Outline)} for each element.
*
Closes the current last outline via {@link #closeLastOutline()} before adding the new ones.
* @param outlineShape OutlineShape elements to be added.
- * @throws NullPointerException if the {@link OutlineShape} is null
+ * @throws NullPointerException if the {@link OutlineShape} is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber())
*/
public void addOutlineShape(OutlineShape outlineShape) throws NullPointerException {
@@ -228,10 +228,10 @@ public class OutlineShape implements Comparable {
/** Replaces the {@link Outline} element at the given {@code position}.
*
Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.
- *
+ *
* @param position of the replaced Outline
- * @param outline replacement Outline object
- * @throws NullPointerException if the {@link Outline} element is null
+ * @param outline replacement Outline object
+ * @throws NullPointerException if the {@link Outline} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
*/
public void setOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException {
@@ -244,7 +244,7 @@ public class OutlineShape implements Comparable {
/** Removes the {@link Outline} element at the given {@code position}.
*
Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.
- *
+ *
* @param position of the to be removed Outline
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
*/
@@ -261,15 +261,15 @@ public class OutlineShape implements Comparable {
return outlines.get(outlines.size()-1);
}
- /** @return the {@code Outline} at {@code position}
+ /** @return the {@code Outline} at {@code position}
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
*/
public Outline getOutline(int position) throws IndexOutOfBoundsException {
return outlines.get(position);
- }
+ }
/** Adds a vertex to the last open outline in the
- * shape.
+ * shape.
* @param v the vertex to be added to the OutlineShape
*/
public final void addVertex(Vertex v) {
@@ -280,9 +280,9 @@ public class OutlineShape implements Comparable {
}
}
- /** Adds a vertex to the last open outline in the shape.
- * at {@code position}
- * @param position indx at which the vertex will be added
+ /** Adds a vertex to the last open outline in the shape.
+ * at {@code position}
+ * @param position indx at which the vertex will be added
* @param v the vertex to be added to the OutlineShape
*/
public final void addVertex(int position, Vertex v) {
@@ -295,7 +295,7 @@ public class OutlineShape implements Comparable {
/** Add a 2D {@link Vertex} to the last outline by defining the coordniate attribute
* of the vertex. The 2D vertex will be represented as Z=0.
- *
+ *
* @param x the x coordinate
* @param y the y coordniate
* @param onCurve flag if this vertex is on the final curve or defines a curved region
@@ -317,10 +317,10 @@ public class OutlineShape implements Comparable {
addVertex(vertexFactory.create(x, y, z, onCurve));
}
- /** Add a vertex to the last outline by passing a float array and specifying the
- * offset and length in which. The attributes of the vertex are located.
+ /** Add a vertex to the last outline by passing a float array and specifying the
+ * offset and length in which. The attributes of the vertex are located.
* The attributes should be continuous (stride = 0).
- * Attributes which value are not set (when length less than 3)
+ * Attributes which value are not set (when length less than 3)
* are set implicitly to zero.
* @param coordsBuffer the coordinate array where the vertex attributes are to be picked from
* @param offset the offset in the buffer to the x coordinate
@@ -330,11 +330,11 @@ public class OutlineShape implements Comparable {
*/
public final void addVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) {
addVertex(vertexFactory.create(coordsBuffer, offset, length, onCurve));
- }
+ }
/** Closes the last outline in the shape.
*
If last vertex is not equal to first vertex.
- * A new temp vertex is added at the end which
+ * A new temp vertex is added at the end which
* is equal to the first.
*/
public void closeLastOutline() {
@@ -351,7 +351,7 @@ public class OutlineShape implements Comparable {
/** Ensure the outlines represent
* the specified destinationType.
* and removes all overlaps in boundary triangles
- * @param destinationType the target outline's vertices state. Currently only
+ * @param destinationType the target outline's vertices state. Currently only
* {@link OutlineShape.VerticesState#QUADRATIC_NURBS} are supported.
*/
public void transformOutlines(VerticesState destinationType) {
@@ -371,7 +371,7 @@ public class OutlineShape implements Comparable {
float[] v2 = VectorUtil.mid(v1, v3);
//drop off-curve vertex to image on the curve
- b.setCoord(v2, 0, 3);
+ b.setCoord(v2, 0, 3);
b.setOnCurve(true);
outline.addVertex(index, vertexFactory.create(v1, 0, 3, false));
@@ -379,19 +379,19 @@ public class OutlineShape implements Comparable {
}
/** Check overlaps between curved triangles
- * first check if any vertex in triangle a is in triangle b
+ * first check if any vertex in triangle a is in triangle b
* second check if edges of triangle a intersect segments of triangle b
* if any of the two tests is true we divide current triangle
* and add the other to the list of overlaps
- *
+ *
* Loop until overlap array is empty. (check only in first pass)
*/
- private void checkOverlaps() {
+ private void checkOverlaps() {
ArrayList overlaps = new ArrayList(3);
int count = getOutlineNumber();
boolean firstpass = true;
do {
- for (int cc = 0; cc < count; cc++) {
+ for (int cc = 0; cc < count; cc++) {
final Outline outline = getOutline(cc);
int vertexCount = outline.getVertexCount();
for(int i=0; i < outline.getVertexCount(); i++) {
@@ -429,7 +429,7 @@ public class OutlineShape implements Comparable {
private Vertex checkTriOverlaps(Vertex a, Vertex b, Vertex c) {
int count = getOutlineNumber();
- for (int cc = 0; cc < count; cc++) {
+ for (int cc = 0; cc < count; cc++) {
final Outline outline = getOutline(cc);
int vertexCount = outline.getVertexCount();
for(int i=0; i < vertexCount; i++) {
@@ -451,7 +451,7 @@ public class OutlineShape implements Comparable {
return current;
}
- if(VectorUtil.tri2SegIntersection(a, b, c, prevV, current)
+ if(VectorUtil.tri2SegIntersection(a, b, c, prevV, current)
|| VectorUtil.tri2SegIntersection(a, b, c, current, nextV)
|| VectorUtil.tri2SegIntersection(a, b, c, prevV, nextV)) {
return current;
@@ -463,7 +463,7 @@ public class OutlineShape implements Comparable {
private void transformOutlines2Quadratic() {
int count = getOutlineNumber();
- for (int cc = 0; cc < count; cc++) {
+ for (int cc = 0; cc < count; cc++) {
final Outline outline = getOutline(cc);
int vertexCount = outline.getVertexCount();
@@ -471,13 +471,13 @@ public class OutlineShape implements Comparable {
final Vertex currentVertex = outline.getVertex(i);
final Vertex nextVertex = outline.getVertex((i+1)%vertexCount);
if ( !currentVertex.isOnCurve() && !nextVertex.isOnCurve() ) {
- final float[] newCoords = VectorUtil.mid(currentVertex.getCoord(),
+ final float[] newCoords = VectorUtil.mid(currentVertex.getCoord(),
nextVertex.getCoord());
final Vertex v = vertexFactory.create(newCoords, 0, 3, true);
i++;
vertexCount++;
outline.addVertex(i, v);
- }
+ }
}
if(vertexCount <= 0) {
outlines.remove(outline);
@@ -487,7 +487,7 @@ public class OutlineShape implements Comparable {
}
if( vertexCount > 0 ) {
- if(VectorUtil.checkEquality(outline.getVertex(0).getCoord(),
+ if(VectorUtil.checkEquality(outline.getVertex(0).getCoord(),
outline.getLastVertex().getCoord())) {
outline.removeVertex(vertexCount-1);
}
@@ -508,7 +508,7 @@ public class OutlineShape implements Comparable {
}
}
- /** @return the list of concatenated vertices associated with all
+ /** @return the list of concatenated vertices associated with all
* {@code Outline}s of this object
*/
public ArrayList getVertices() {
@@ -551,7 +551,7 @@ public class OutlineShape implements Comparable {
}
/** Compare two outline shapes with Bounding Box area
- * as criteria.
+ * as criteria.
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public final int compareTo(OutlineShape outline) {
@@ -579,12 +579,12 @@ public class OutlineShape implements Comparable {
validateBoundingBox();
}
return bbox;
- }
+ }
/**
* @param obj the Object to compare this OutlineShape with
- * @return true if {@code obj} is an OutlineShape, not null,
- * same outlineState, equal bounds and equal outlines in the same order
+ * @return true if {@code obj} is an OutlineShape, not null,
+ * same outlineState, equal bounds and equal outlines in the same order
*/
public boolean equals(Object obj) {
if( obj == this) {
@@ -592,7 +592,7 @@ public class OutlineShape implements Comparable {
}
if( null == obj || !(obj instanceof OutlineShape) ) {
return false;
- }
+ }
final OutlineShape o = (OutlineShape) obj;
if(getOutlineState() != o.getOutlineState()) {
return false;
@@ -625,5 +625,5 @@ public class OutlineShape implements Comparable {
o.outlines.add(outlines.get(i).clone());
}
return o;
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java
index 8b6d000fa..a9779523a 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/Region.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java
@@ -38,48 +38,48 @@ import com.jogamp.opengl.math.geom.AABBox;
/** Abstract Outline shape GL representation
* define the method an OutlineShape(s) is
* binded rendered.
- *
+ *
* @see GLRegion
*/
public abstract class Region {
-
+
/** Debug flag for region impl (graph.curve)
*/
public static final boolean DEBUG = Debug.debug("graph.curve");
-
+
public static final boolean DEBUG_INSTANCE = false;
- /** View based Anti-Aliasing, A Two pass region rendering, slower
- * and more resource hungry (FBO), but AA is perfect.
- * Otherwise the default fast one pass MSAA region rendering is being used.
+ /** View based Anti-Aliasing, A Two pass region rendering, slower
+ * and more resource hungry (FBO), but AA is perfect.
+ * Otherwise the default fast one pass MSAA region rendering is being used.
*/
public static final int VBAA_RENDERING_BIT = 1 << 0;
/** Use non uniform weights [0.0 .. 1.9] for curve region rendering.
- * Otherwise the default weight 1.0 for uniform curve region rendering is being applied.
+ * Otherwise the default weight 1.0 for uniform curve region rendering is being applied.
*/
public static final int VARIABLE_CURVE_WEIGHT_BIT = 1 << 1;
public static final int TWO_PASS_DEFAULT_TEXTURE_UNIT = 0;
private final int renderModes;
- private boolean dirty = true;
- protected int numVertices = 0;
+ private boolean dirty = true;
+ protected int numVertices = 0;
protected final AABBox box = new AABBox();
protected ArrayList triangles = new ArrayList();
protected ArrayList vertices = new ArrayList();
- public static boolean isVBAA(int renderModes) {
- return 0 != ( renderModes & Region.VBAA_RENDERING_BIT );
+ public static boolean isVBAA(int renderModes) {
+ return 0 != ( renderModes & Region.VBAA_RENDERING_BIT );
}
/** Check if render mode capable of non uniform weights
- * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
- * {@link Region#VBAA_RENDERING_BIT}
+ * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
+ * {@link Region#VBAA_RENDERING_BIT}
* @return true of capable of non uniform weights
*/
- public static boolean isNonUniformWeight(int renderModes) {
- return 0 != ( renderModes & Region.VARIABLE_CURVE_WEIGHT_BIT );
+ public static boolean isNonUniformWeight(int renderModes) {
+ return 0 != ( renderModes & Region.VARIABLE_CURVE_WEIGHT_BIT );
}
protected Region(int regionRenderModes) {
@@ -87,28 +87,28 @@ public abstract class Region {
}
/** Get current Models
- * @return bit-field of render modes
+ * @return bit-field of render modes
*/
- public final int getRenderModes() {
- return renderModes;
+ public final int getRenderModes() {
+ return renderModes;
}
/** Check if current Region is using VBAA
* @return true if capable of two pass rendering - VBAA
*/
- public boolean isVBAA() {
- return Region.isVBAA(renderModes);
+ public boolean isVBAA() {
+ return Region.isVBAA(renderModes);
}
- /** Check if current instance uses non uniform weights
+ /** Check if current instance uses non uniform weights
* @return true if capable of nonuniform weights
*/
- public boolean isNonUniformWeight() {
- return Region.isNonUniformWeight(renderModes);
+ public boolean isNonUniformWeight() {
+ return Region.isNonUniformWeight(renderModes);
}
/** Get the current number of vertices associated
- * with this region. This number is not necessary equal to
+ * with this region. This number is not necessary equal to
* the OGL bound number of vertices.
* @return vertices count
*/
@@ -117,10 +117,10 @@ public abstract class Region {
}
/** Adds a {@link Triangle} object to the Region
- * This triangle will be bound to OGL objects
+ * This triangle will be bound to OGL objects
* on the next call to {@code update}
* @param tri a triangle object
- *
+ *
* @see update(GL2ES2)
*/
public void addTriangle(Triangle tri) {
@@ -129,10 +129,10 @@ public abstract class Region {
}
/** Adds a list of {@link Triangle} objects to the Region
- * These triangles are to be binded to OGL objects
+ * These triangles are to be binded to OGL objects
* on the next call to {@code update}
* @param tris an arraylist of triangle objects
- *
+ *
* @see update(GL2ES2)
*/
public void addTriangles(ArrayList tris) {
@@ -141,10 +141,10 @@ public abstract class Region {
}
/** Adds a {@link Vertex} object to the Region
- * This vertex will be bound to OGL objects
+ * This vertex will be bound to OGL objects
* on the next call to {@code update}
* @param vert a vertex objects
- *
+ *
* @see update(GL2ES2)
*/
public void addVertex(Vertex vert) {
@@ -154,10 +154,10 @@ public abstract class Region {
}
/** Adds a list of {@link Vertex} objects to the Region
- * These vertices are to be binded to OGL objects
+ * These vertices are to be binded to OGL objects
* on the next call to {@code update}
* @param verts an arraylist of vertex objects
- *
+ *
* @see update(GL2ES2)
*/
public void addVertices(ArrayList verts) {
@@ -175,10 +175,10 @@ public abstract class Region {
}
/** Check if this region is dirty. A region is marked dirty
- * when new Vertices, Triangles, and or Lines are added after a
+ * when new Vertices, Triangles, and or Lines are added after a
* call to update()
* @return true if region is Dirty, false otherwise
- *
+ *
* @see update(GL2ES2)
*/
public final boolean isDirty() {
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
index 63713887b..dfb7a95b3 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
@@ -41,32 +41,32 @@ import jogamp.graph.curve.opengl.RegionFactory;
/** A GLRegion is the OGL binding of one or more OutlineShapes
* Defined by its vertices and generated triangles. The Region
- * defines the final shape of the OutlineShape(s), which shall produced a shaded
+ * defines the final shape of the OutlineShape(s), which shall produced a shaded
* region on the screen.
- *
- * Implementations of the GLRegion shall take care of the OGL
+ *
+ * Implementations of the GLRegion shall take care of the OGL
* binding of the depending on its context, profile.
- *
+ *
* @see Region, RegionFactory, OutlineShape
*/
-public abstract class GLRegion extends Region {
-
+public abstract class GLRegion extends Region {
+
/** Create an ogl {@link GLRegion} defining the list of {@link OutlineShape}.
* Combining the Shapes into single buffers.
* @return the resulting Region inclusive the generated region
*/
public static GLRegion create(OutlineShape[] outlineShapes, int renderModes) {
final GLRegion region = RegionFactory.create(renderModes);
-
+
int numVertices = region.getNumVertices();
-
+
for(int index=0; index triangles = outlineShape.triangulate();
region.addTriangles(triangles);
-
+
ArrayList vertices = outlineShape.getVertices();
for(int pos=0; pos < vertices.size(); pos++){
Vertex vert = vertices.get(pos);
@@ -74,42 +74,42 @@ public abstract class GLRegion extends Region {
}
region.addVertices(vertices);
}
-
+
return region;
}
- /**
+ /**
* Create an ogl {@link GLRegion} defining this {@link OutlineShape}
* @return the resulting Region.
*/
public static GLRegion create(OutlineShape outlineShape, int renderModes) {
final GLRegion region = RegionFactory.create(renderModes);
-
+
outlineShape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
ArrayList triangles = (ArrayList) outlineShape.triangulate();
ArrayList vertices = (ArrayList) outlineShape.getVertices();
region.addVertices(vertices);
region.addTriangles(triangles);
return region;
- }
-
+ }
+
protected GLRegion(int renderModes) {
super(renderModes);
}
-
+
/** Updates a graph region by updating the ogl related
* objects for use in rendering if {@link #isDirty()}.
- *
Allocates the ogl related data and initializes it the 1st time.
+ *
Allocates the ogl related data and initializes it the 1st time.
*
Called by {@link #draw(GL2ES2, RenderState, int, int, int)}.
* @param rs TODO
*/
protected abstract void update(GL2ES2 gl, RenderState rs);
-
+
/** Delete and clean the associated OGL
* objects
*/
public abstract void destroy(GL2ES2 gl, RenderState rs);
-
+
/** Renders the associated OGL objects specifying
* current width/hight of window for multi pass rendering
* of the region.
@@ -117,13 +117,13 @@ public abstract class GLRegion extends Region {
* @param rs the RenderState to be used
* @param vp_width current screen width
* @param vp_height current screen height
- * @param texWidth desired texture width for multipass-rendering.
+ * @param texWidth desired texture width for multipass-rendering.
* The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
*/
public final void draw(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
update(gl, rs);
drawImpl(gl, rs, vp_width, vp_height, texWidth);
}
-
+
protected abstract void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth);
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
index 2f078d7bb..f7d4bfd2f 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -35,26 +35,26 @@ import com.jogamp.graph.curve.Region;
public abstract class RegionRenderer extends Renderer {
- /**
+ /**
* Create a Hardware accelerated Region Renderer.
- * @param rs the used {@link RenderState}
- * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
+ * @param rs the used {@link RenderState}
+ * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
* @return an instance of Region Renderer
*/
public static RegionRenderer create(RenderState rs, int renderModes) {
return new jogamp.graph.curve.opengl.RegionRendererImpl01(rs, renderModes);
}
-
+
protected RegionRenderer(RenderState rs, int renderModes) {
super(rs, renderModes);
}
-
-
+
+
/** Render an {@link OutlineShape} in 3D space at the position provided
* the triangles of the shapes will be generated, if not yet generated
* @param region the OutlineShape to Render.
- * @param position the initial translation of the outlineShape.
- * @param texWidth desired texture width for multipass-rendering.
+ * @param position the initial translation of the outlineShape.
+ * @param texWidth desired texture width for multipass-rendering.
* The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
* @throws Exception if HwRegionRenderer not initialized
*/
@@ -65,10 +65,10 @@ public abstract class RegionRenderer extends Renderer {
if( !areRenderModesCompatible(region) ) {
throw new GLException("Incompatible render modes, : region modes "+region.getRenderModes()+
" doesn't contain renderer modes "+this.getRenderModes());
- }
+ }
drawImpl(gl, region, position, texWidth);
}
-
+
/**
* Usually just dispatched the draw call to the Region's draw implementation,
* e.g. {@link com.jogamp.graph.curve.opengl.GLRegion#draw(GL2ES2, RenderState, int, int, int[]) GLRegion#draw(GL2ES2, RenderState, int, int, int[])}.
@@ -79,6 +79,6 @@ public abstract class RegionRenderer extends Renderer {
protected void destroyImpl(GL2ES2 gl) {
// nop
}
-
-
+
+
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
index 5e305d664..9c833fd24 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
@@ -40,7 +40,7 @@ import com.jogamp.opengl.util.glsl.ShaderState;
public abstract class RenderState {
private static final String thisKey = "jogamp.graph.curve.RenderState" ;
-
+
public static RenderState createRenderState(ShaderState st, Vertex.Factory extends Vertex> pointFactory) {
return new RenderStateImpl(st, pointFactory);
}
@@ -48,42 +48,42 @@ public abstract class RenderState {
public static RenderState createRenderState(ShaderState st, Vertex.Factory extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
return new RenderStateImpl(st, pointFactory, pmvMatrix);
}
-
+
public static final RenderState getRenderState(GL2ES2 gl) {
return (RenderState) gl.getContext().getAttachedObject(thisKey);
}
-
+
protected final ShaderState st;
protected final Vertex.Factory extends Vertex> vertexFactory;
protected final PMVMatrix pmvMatrix;
- protected final GLUniformData gcu_PMVMatrix;
-
+ protected final GLUniformData gcu_PMVMatrix;
+
protected RenderState(ShaderState st, Vertex.Factory extends Vertex> vertexFactory, PMVMatrix pmvMatrix) {
this.st = st;
this.vertexFactory = vertexFactory;
- this.pmvMatrix = pmvMatrix;
+ this.pmvMatrix = pmvMatrix;
this.gcu_PMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, pmvMatrix.glGetPMvMatrixf());
- st.ownUniform(gcu_PMVMatrix);
+ st.ownUniform(gcu_PMVMatrix);
}
-
+
public final ShaderState getShaderState() { return st; }
public final Vertex.Factory extends Vertex> getVertexFactory() { return vertexFactory; }
public final PMVMatrix pmvMatrix() { return pmvMatrix; }
public final GLUniformData getPMVMatrix() { return gcu_PMVMatrix; }
-
+
public void destroy(GL2ES2 gl) {
st.destroy(gl);
}
-
+
public abstract GLUniformData getWeight();
public abstract GLUniformData getAlpha();
public abstract GLUniformData getColorStatic();
// public abstract GLUniformData getStrength();
-
+
public final RenderState attachTo(GL2ES2 gl) {
return (RenderState) gl.getContext().attachObject(thisKey, this);
}
-
+
public final boolean detachFrom(GL2ES2 gl) {
RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey);
if(_rs == this) {
@@ -91,8 +91,8 @@ public abstract class RenderState {
return true;
}
return false;
- }
-
+ }
+
public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
if(null==sb) {
sb = new StringBuilder();
@@ -104,8 +104,8 @@ public abstract class RenderState {
return sb;
}
-
+
public String toString() {
return toString(null, false).toString();
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
index 998129551..c642fb652 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
@@ -52,8 +52,8 @@ public abstract class Renderer {
protected int vp_height;
protected boolean initialized;
protected final RenderState rs;
- private boolean vboSupported = false;
-
+ private boolean vboSupported = false;
+
public final boolean isInitialized() { return initialized; }
public final int getWidth() { return vp_width; }
@@ -62,29 +62,29 @@ public abstract class Renderer {
public float getWeight() { return rs.getWeight().floatValue(); }
public float getAlpha() { return rs.getAlpha().floatValue(); }
public final PMVMatrix getMatrix() { return rs.pmvMatrix(); }
-
+
/**
* Implementation shall load, compile and link the shader program and leave it active.
* @param gl referencing the current GLContext to which the ShaderState is bound to
* @return
*/
protected abstract boolean initShaderProgram(GL2ES2 gl);
-
+
protected abstract void destroyImpl(GL2ES2 gl);
-
+
/**
- * @param rs the used {@link RenderState}
+ * @param rs the used {@link RenderState}
* @param renderModes bit-field of modes
*/
protected Renderer(RenderState rs, int renderModes) {
this.rs = rs;
this.renderModes = renderModes;
}
-
+
public final int getRenderModes() {
return renderModes;
}
-
+
public boolean usesVariableCurveWeight() { return Region.isNonUniformWeight(renderModes); }
/**
@@ -93,17 +93,17 @@ public abstract class Renderer {
*/
public final boolean areRenderModesCompatible(Region region) {
final int cleanRenderModes = getRenderModes() & ( Region.VARIABLE_CURVE_WEIGHT_BIT );
- return cleanRenderModes == ( region.getRenderModes() & cleanRenderModes );
+ return cleanRenderModes == ( region.getRenderModes() & cleanRenderModes );
}
-
+
public final boolean isVBOSupported() { return vboSupported; }
-
- /**
+
+ /**
* Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext
* if not initialized yet.
*
Leaves the renderer enabled, ie ShaderState.
*
Shall be called by a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, float[], int)}
- *
+ *
* @param gl referencing the current GLContext to which the ShaderState is bound to
* @throws GLException if initialization failed
*/
@@ -117,48 +117,48 @@ public abstract class Renderer {
gl.isFunctionAvailable("glDrawElements") &&
gl.isFunctionAvailable("glVertexAttribPointer") &&
gl.isFunctionAvailable("glDeleteBuffers");
-
+
if(DEBUG) {
System.err.println("TextRendererImpl01: VBO Supported = " + isVBOSupported());
}
-
+
if(!vboSupported){
throw new GLException("VBO not supported");
}
-
+
rs.attachTo(gl);
-
+
gl.glEnable(GL2ES2.GL_BLEND);
gl.glBlendFunc(GL2ES2.GL_SRC_ALPHA, GL2ES2.GL_ONE_MINUS_SRC_ALPHA); // FIXME: alpha blending stage ?
-
+
initialized = initShaderProgram(gl);
if(!initialized) {
throw new GLException("Shader initialization failed");
}
-
+
if(!rs.getShaderState().uniform(gl, rs.getPMVMatrix())) {
throw new GLException("Error setting PMVMatrix in shader: "+rs.getShaderState());
}
-
+
if( Region.isNonUniformWeight( getRenderModes() ) ) {
if(!rs.getShaderState().uniform(gl, rs.getWeight())) {
throw new GLException("Error setting weight in shader: "+rs.getShaderState());
}
}
-
+
if(!rs.getShaderState().uniform(gl, rs.getAlpha())) {
throw new GLException("Error setting global alpha in shader: "+rs.getShaderState());
- }
-
+ }
+
if(!rs.getShaderState().uniform(gl, rs.getColorStatic())) {
throw new GLException("Error setting global color in shader: "+rs.getShaderState());
- }
+ }
}
- public final void flushCache(GL2ES2 gl) {
+ public final void flushCache(GL2ES2 gl) {
// FIXME: REMOVE !
}
-
+
public void destroy(GL2ES2 gl) {
if(!initialized){
if(DEBUG_INSTANCE) {
@@ -169,13 +169,13 @@ public abstract class Renderer {
rs.getShaderState().useProgram(gl, false);
destroyImpl(gl);
rs.destroy(gl);
- initialized = false;
+ initialized = false;
}
-
+
public final RenderState getRenderState() { return rs; }
public final ShaderState getShaderState() { return rs.getShaderState(); }
-
- public final void enable(GL2ES2 gl, boolean enable) {
+
+ public final void enable(GL2ES2 gl, boolean enable) {
rs.getShaderState().useProgram(gl, enable);
}
@@ -188,7 +188,7 @@ public abstract class Renderer {
rs.getShaderState().uniform(gl, rs.getWeight());
}
}
-
+
public void setAlpha(GL2ES2 gl, float alpha_t) {
rs.getAlpha().setData(alpha_t);
if(null != gl && rs.getShaderState().inUse()) {
@@ -199,11 +199,11 @@ public abstract class Renderer {
public void getColorStatic(GL2ES2 gl, float[] rgb) {
FloatBuffer fb = (FloatBuffer) rs.getColorStatic().getBuffer();
- rgb[0] = fb.get(0);
- rgb[1] = fb.get(1);
- rgb[2] = fb.get(2);
+ rgb[0] = fb.get(0);
+ rgb[1] = fb.get(1);
+ rgb[2] = fb.get(2);
}
-
+
public void setColorStatic(GL2ES2 gl, float r, float g, float b){
FloatBuffer fb = (FloatBuffer) rs.getColorStatic().getBuffer();
fb.put(0, r);
@@ -213,7 +213,7 @@ public abstract class Renderer {
rs.getShaderState().uniform(gl, rs.getColorStatic());
}
}
-
+
public void rotate(GL2ES2 gl, float angle, float x, float y, float z) {
rs.pmvMatrix().glRotatef(angle, x, y, z);
updateMatrix(gl);
@@ -223,7 +223,7 @@ public abstract class Renderer {
rs.pmvMatrix().glTranslatef(x, y, z);
updateMatrix(gl);
}
-
+
public void scale(GL2ES2 gl, float x, float y, float z) {
rs.pmvMatrix().glScalef(x, y, z);
updateMatrix(gl);
@@ -261,15 +261,15 @@ public abstract class Renderer {
p.glLoadIdentity();
p.glOrthof(0, width, 0, height, near, far);
updateMatrix(gl);
- return true;
+ return true;
}
protected String getVertexShaderName() {
return "curverenderer" + getImplVersion();
}
-
+
protected String getFragmentShaderName() {
- final String version = getImplVersion();
+ final String version = getImplVersion();
final String pass = Region.isVBAA(renderModes) ? "-2pass" : "-1pass" ;
final String weight = Region.isNonUniformWeight(renderModes) ? "-weight" : "" ;
return "curverenderer" + version + pass + weight;
@@ -277,7 +277,7 @@ public abstract class Renderer {
// FIXME: Really required to have sampler2D def. precision ? If not, we can drop getFragmentShaderPrecision(..) and use default ShaderCode ..
public static final String es2_precision_fp = "\nprecision mediump float;\nprecision mediump int;\nprecision mediump sampler2D;\n";
-
+
protected String getFragmentShaderPrecision(GL2ES2 gl) {
if( gl.isGLES2() ) {
return es2_precision_fp;
@@ -287,7 +287,7 @@ public abstract class Renderer {
}
return null;
}
-
+
protected String getImplVersion() {
return "01";
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java
index 8dc41b0c0..f6ce852d8 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java
@@ -38,28 +38,28 @@ import jogamp.graph.curve.text.GlyphString;
import com.jogamp.graph.font.Font;
public abstract class TextRenderer extends Renderer {
- /**
+ /**
* Create a Hardware accelerated Text Renderer.
- * @param rs the used {@link RenderState}
+ * @param rs the used {@link RenderState}
* @param renderModes either {@link com.jogamp.graph.curve.opengl.GLRegion#SINGLE_PASS} or {@link com.jogamp.graph.curve.Region#VBAA_RENDERING_BIT}
*/
public static TextRenderer create(RenderState rs, int renderModes) {
return new jogamp.graph.curve.opengl.TextRendererImpl01(rs, renderModes);
}
-
+
protected TextRenderer(RenderState rs, int type) {
super(rs, type);
}
-
+
/** Render the String in 3D space wrt to the font provided at the position provided
* the outlines will be generated, if not yet generated
* @param gl the current GL state
* @param font {@link Font} to be used
- * @param str text to be rendered
- * @param position the lower left corner of the string
+ * @param str text to be rendered
+ * @param position the lower left corner of the string
* @param fontSize font size
- * @param texWidth desired texture width for multipass-rendering.
+ * @param texWidth desired texture width for multipass-rendering.
* The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
* @throws Exception if TextRenderer not initialized
*/
@@ -77,11 +77,11 @@ public abstract class TextRenderer extends Renderer {
if(DEBUG_INSTANCE) {
System.err.println("createString: "+getCacheSize()+"/"+getCacheLimit()+" - "+Font.NAME_UNIQUNAME + " - " + str + " - " + size);
}
- final GlyphString glyphString = GlyphString.createString(null, rs.getVertexFactory(), font, size, str);
- glyphString.createRegion(gl, renderModes);
+ final GlyphString glyphString = GlyphString.createString(null, rs.getVertexFactory(), font, size, str);
+ glyphString.createRegion(gl, renderModes);
return glyphString;
}
-
+
/** FIXME
public void flushCache(GL2ES2 gl) {
Iterator iterator = stringCacheMap.values().iterator();
@@ -89,10 +89,10 @@ public abstract class TextRenderer extends Renderer {
GlyphString glyphString = iterator.next();
glyphString.destroy(gl, rs);
}
- stringCacheMap.clear();
+ stringCacheMap.clear();
stringCacheArray.clear();
} */
-
+
@Override
protected void destroyImpl(GL2ES2 gl) {
// fluchCache(gl) already called
@@ -101,42 +101,42 @@ public abstract class TextRenderer extends Renderer {
GlyphString glyphString = iterator.next();
glyphString.destroy(gl, rs);
}
- stringCacheMap.clear();
+ stringCacheMap.clear();
stringCacheArray.clear();
}
-
+
/**
*
Sets the cache limit for reusing GlyphString's and their Region.
* Default is {@link #DEFAULT_CACHE_LIMIT}, -1 unlimited, 0 turns cache off, >0 limited
- *
+ *
*
The cache will be validate when the next string rendering happens.
- *
+ *
* @param newLimit new cache size
- *
+ *
* @see #DEFAULT_CACHE_LIMIT
*/
public final void setCacheLimit(int newLimit ) { stringCacheLimit = newLimit; }
-
+
/**
* Sets the cache limit, see {@link #setCacheLimit(int)} and validates the cache.
- *
+ *
* @see #setCacheLimit(int)
- *
+ *
* @param gl current GL used to remove cached objects if required
* @param newLimit new cache size
*/
public final void setCacheLimit(GL2ES2 gl, int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); }
-
+
/**
* @return the current cache limit
*/
public final int getCacheLimit() { return stringCacheLimit; }
-
- /**
+
+ /**
* @return the current utilized cache size, <= {@link #getCacheLimit()}
*/
public final int getCacheSize() { return stringCacheArray.size(); }
-
+
protected final void validateCache(GL2ES2 gl, int space) {
if ( getCacheLimit() > 0 ) {
while ( getCacheSize() + space > getCacheLimit() ) {
@@ -144,7 +144,7 @@ public abstract class TextRenderer extends Renderer {
}
}
}
-
+
protected final GlyphString getCachedGlyphString(Font font, String str, int fontSize) {
return stringCacheMap.get(getKey(font, str, fontSize));
}
@@ -160,13 +160,13 @@ public abstract class TextRenderer extends Renderer {
} /// else overwrite is nop ..
}
}
-
+
protected final void removeCachedGlyphString(GL2ES2 gl, Font font, String str, int fontSize) {
final String key = getKey(font, str, fontSize);
GlyphString glyphString = stringCacheMap.remove(key);
if(null != glyphString) {
glyphString.destroy(gl, rs);
- }
+ }
stringCacheArray.remove(key);
}
@@ -177,7 +177,7 @@ public abstract class TextRenderer extends Renderer {
glyphString.destroy(gl, rs);
}
}
-
+
protected final String getKey(Font font, String str, int fontSize) {
final StringBuilder sb = new StringBuilder();
return font.getName(sb, Font.NAME_UNIQUNAME)
@@ -186,8 +186,8 @@ public abstract class TextRenderer extends Renderer {
/** Default cache limit, see {@link #setCacheLimit(int)} */
public static final int DEFAULT_CACHE_LIMIT = 256;
-
+
private HashMap stringCacheMap = new HashMap(DEFAULT_CACHE_LIMIT);
private ArrayList stringCacheArray = new ArrayList(DEFAULT_CACHE_LIMIT);
- private int stringCacheLimit = DEFAULT_CACHE_LIMIT;
+ private int stringCacheLimit = DEFAULT_CACHE_LIMIT;
}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulation.java b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulation.java
index 7728efcaf..ae2849536 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulation.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulation.java
@@ -33,7 +33,7 @@ import jogamp.graph.curve.tess.CDTriangulator2D;
public class Triangulation {
/** Create a new instance of a triangulation.
- * Currently only a modified version of Constraint Delaunay
+ * Currently only a modified version of Constraint Delaunay
* is implemented.
* @return instance of a triangulator
* @see Triangulator
diff --git a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
index 1ffaccebc..4e8c400e0 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
@@ -36,32 +36,32 @@ import com.jogamp.graph.geom.Triangle;
/** Interface to the triangulation algorithms provided
* A triangulation of 2D outlines where you can
* provides an easy one or more outlines to be triangulated
- *
+ *
* example usage:
* addCurve(o1);
* addCurve(o2);
* addCurve(o3);
* generate();
* reset();
- *
+ *
* @see Outline
* @see Triangulation
*/
public interface Triangulator {
-
+
/** Add a curve to the list of Outlines
* describing the shape
* @param outline a bounding {@link Outline}
*/
public void addCurve(Outline outline);
-
- /** Generate the triangulation of the provided
+
+ /** Generate the triangulation of the provided
* List of {@link Outline}s
* @return an arraylist of {@link Triangle}s resembling the
* final shape.
*/
public ArrayList generate();
-
+
/** Reset the triangulation to initial state
* Clearing cached data
*/
diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java
index 64a3a3e6c..82211da92 100644
--- a/src/jogl/classes/com/jogamp/graph/font/Font.java
+++ b/src/jogl/classes/com/jogamp/graph/font/Font.java
@@ -31,10 +31,10 @@ import com.jogamp.opengl.math.geom.AABBox;
/**
* Interface wrapper for font implementation.
- *
+ *
* TrueType Font Specification:
* http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html
- *
+ *
* TrueType Font Table Introduction:
* http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08
*/
@@ -50,22 +50,22 @@ public interface Font {
public static final int NAME_VERSION = 5;
public static final int NAME_MANUFACTURER = 8;
public static final int NAME_DESIGNER = 9;
-
-
+
+
/**
* Metrics for font
- *
+ *
* Depending on the font's direction, horizontal or vertical,
* the following tables shall be used:
- *
+ *
* Vertical http://developer.apple.com/fonts/TTRefMan/RM06/Chap6vhea.html
* Horizontal http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html
*/
- public interface Metrics {
+ public interface Metrics {
float getAscent(float pixelSize);
float getDescent(float pixelSize);
float getLineGap(float pixelSize);
- float getMaxExtend(float pixelSize);
+ float getMaxExtend(float pixelSize);
float getScale(float pixelSize);
AABBox getBBox(float pixelSize);
}
@@ -74,12 +74,12 @@ public interface Font {
* Glyph for font
*/
public interface Glyph {
- // reserved special glyph IDs
+ // reserved special glyph IDs
// http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08#ba57949e
public static final int ID_UNKNOWN = 0;
public static final int ID_CR = 2;
public static final int ID_SPACE = 3;
-
+
public Font getFont();
public char getSymbol();
public AABBox getBBox(float pixelSize);
@@ -89,25 +89,25 @@ public interface Font {
public String getName(int nameIndex);
public StringBuilder getName(StringBuilder string, int nameIndex);
-
+
/** Shall return the family and subfamily name, separated a dash.
*
{@link #getName(StringBuilder, int)} w/ {@link #NAME_FAMILY} and {@link #NAME_SUBFAMILY}
*
Example: "{@code Ubuntu-Regular}"
*/
public StringBuilder getFullFamilyName(StringBuilder buffer);
-
+
public StringBuilder getAllNames(StringBuilder string, String separator);
-
+
public float getAdvanceWidth(int i, float pixelSize);
public Metrics getMetrics();
public Glyph getGlyph(char symbol);
public int getNumGlyphs();
-
+
public float getStringWidth(CharSequence string, float pixelSize);
public float getStringHeight(CharSequence string, float pixelSize);
public AABBox getStringBounds(CharSequence string, float pixelSize);
-
- public boolean isPrintableChar( char c );
-
+
+ public boolean isPrintableChar( char c );
+
/** Shall return {@link #getFullFamilyName()} */
public String toString();
}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
index d2824b9dc..884662e6e 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
@@ -49,13 +49,13 @@ import jogamp.graph.font.UbuntuFontLoader;
public class FontFactory {
private static final String FontConstructorPropKey = "jogamp.graph.font.ctor";
private static final String DefaultFontConstructor = "jogamp.graph.font.typecast.TypecastFontConstructor";
-
+
/** Ubuntu is the default font family */
public static final int UBUNTU = 0;
-
+
/** Java fonts are optional */
public static final int JAVA = 1;
-
+
private static final FontConstructor fontConstr;
static {
@@ -63,18 +63,18 @@ public class FontFactory {
* For example:
* "jogamp.graph.font.typecast.TypecastFontFactory" (default)
* "jogamp.graph.font.ttf.TTFFontImpl"
- */
+ */
String fontImplName = PropertyAccess.getProperty(FontConstructorPropKey, true);
if(null == fontImplName) {
fontImplName = DefaultFontConstructor;
}
fontConstr = (FontConstructor) ReflectionUtil.createInstance(fontImplName, FontFactory.class.getClassLoader());
}
-
+
public static final FontSet getDefault() {
return get(UBUNTU);
}
-
+
public static final FontSet get(int font) {
switch (font) {
case JAVA:
@@ -83,15 +83,15 @@ public class FontFactory {
return UbuntuFontLoader.get();
}
}
-
+
public static final Font get(File file) throws IOException {
return fontConstr.create(file);
}
public static final Font get(final URLConnection conn) throws IOException {
return fontConstr.create(conn);
- }
-
+ }
+
public static boolean isPrintableChar( char c ) {
if( Character.isWhitespace(c) ) {
return true;
@@ -101,5 +101,5 @@ public class FontFactory {
}
final Character.UnicodeBlock block = Character.UnicodeBlock.of( c );
return block != null && block != Character.UnicodeBlock.SPECIALS;
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontSet.java b/src/jogl/classes/com/jogamp/graph/font/FontSet.java
index d376922ab..17b8b2136 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontSet.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontSet.java
@@ -34,29 +34,29 @@ public interface FontSet {
/** Font family REGULAR **/
public static final int FAMILY_REGULAR = 0;
-
+
/** Font family LIGHT **/
public static final int FAMILY_LIGHT = 1;
-
+
/** Font family MEDIUM **/
public static final int FAMILY_MEDIUM = 2;
-
+
/** Font family CONDENSED **/
public static final int FAMILY_CONDENSED = 3;
-
+
/** Font family MONO **/
public static final int FAMILY_MONOSPACED = 4;
-
+
/** SERIF style/family bit flag. Fallback to Sans Serif. */
public static final int STYLE_SERIF = 1 << 1;
-
+
/** BOLD style bit flag */
public static final int STYLE_BOLD = 1 << 2;
-
+
/** ITALIC style bit flag */
public static final int STYLE_ITALIC = 1 << 3;
Font getDefault() throws IOException ;
-
+
Font get(int family, int stylebits) throws IOException ;
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
index 12c45860b..dfa6a8635 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
@@ -36,12 +36,12 @@ import com.jogamp.opengl.math.geom.AABBox;
/** Define a single continuous stroke by control vertices.
- * The vertices define the shape of the region defined by this
+ * The vertices define the shape of the region defined by this
* outline. The Outline can contain a list of off-curve and on-curve
* vertices which define curved regions.
- *
+ *
* Note: An outline should be closed to be rendered as a region.
- *
+ *
* @see OutlineShape, Region
*/
public class Outline implements Cloneable, Comparable {
@@ -55,7 +55,7 @@ public class Outline implements Cloneable, Comparable {
* An outline can contain off Curve vertices which define curved
* regions in the outline.
*/
- public Outline() {
+ public Outline() {
}
public final int getVertexCount() {
@@ -64,7 +64,7 @@ public class Outline implements Cloneable, Comparable {
/** Appends a vertex to the outline loop/strip.
* @param vertex Vertex to be added
- * @throws NullPointerException if the {@link Vertex} element is null
+ * @throws NullPointerException if the {@link Vertex} element is null
*/
public final void addVertex(Vertex vertex) throws NullPointerException {
addVertex(vertices.size(), vertex);
@@ -73,7 +73,7 @@ public class Outline implements Cloneable, Comparable {
/** Insert the {@link Vertex} element at the given {@code position} to the outline loop/strip.
* @param position of the added Vertex
* @param vertex Vertex object to be added
- * @throws NullPointerException if the {@link Vertex} element is null
+ * @throws NullPointerException if the {@link Vertex} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getVertexNumber())
*/
public final void addVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
@@ -88,10 +88,10 @@ public class Outline implements Cloneable, Comparable {
/** Replaces the {@link Vertex} element at the given {@code position}.
*
Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.
- *
+ *
* @param position of the replaced Vertex
- * @param vertex replacement Vertex object
- * @throws NullPointerException if the {@link Outline} element is null
+ * @param vertex replacement Vertex object
+ * @throws NullPointerException if the {@link Outline} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
*/
public final void setVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
@@ -112,12 +112,12 @@ public class Outline implements Cloneable, Comparable {
/** Removes the {@link Vertex} element at the given {@code position}.
*
Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.
- *
+ *
* @param position of the to be removed Vertex
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
*/
public final Vertex removeVertex(int position) throws IndexOutOfBoundsException {
- dirtyBBox = true;
+ dirtyBBox = true;
return vertices.remove(position);
}
@@ -139,7 +139,7 @@ public class Outline implements Cloneable, Comparable {
/**
* Use the given outline loop/strip.
*
Validates the bounding box.
- *
+ *
* @param vertices the new outline loop/strip
*/
public final void setVertices(ArrayList vertices) {
@@ -152,7 +152,7 @@ public class Outline implements Cloneable, Comparable {
}
/** define if this outline is closed or not.
- * if set to closed, checks if the last vertex is
+ * if set to closed, checks if the last vertex is
* equal to the first vertex. If not Equal adds a
* vertex at the end to the list.
* @param closed
@@ -170,7 +170,7 @@ public class Outline implements Cloneable, Comparable {
}
/** Compare two outlines with Bounding Box area
- * as criteria.
+ * as criteria.
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public final int compareTo(Outline outline) {
@@ -198,11 +198,11 @@ public class Outline implements Cloneable, Comparable {
validateBoundingBox();
}
return bbox;
- }
+ }
/**
* @param obj the Object to compare this Outline with
- * @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order
+ * @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order
*/
public boolean equals(Object obj) {
if( obj == this) {
@@ -210,7 +210,7 @@ public class Outline implements Cloneable, Comparable {
}
if( null == obj || !(obj instanceof Outline) ) {
return false;
- }
+ }
final Outline o = (Outline) obj;
if(getVertexCount() != o.getVertexCount()) {
return false;
@@ -240,5 +240,5 @@ public class Outline implements Cloneable, Comparable {
o.vertices.add(vertices.get(i).clone());
}
return o;
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
index fb34de221..bd0900495 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
@@ -48,11 +48,11 @@ public class Triangle {
public Vertex[] getVertices() {
return vertices;
}
-
+
public boolean isEdgesBoundary() {
return boundaryEdges[0] || boundaryEdges[1] || boundaryEdges[2];
}
-
+
public boolean isVerticesBoundary() {
return boundaryVertices[0] || boundaryVertices[1] || boundaryVertices[2];
}
@@ -60,11 +60,11 @@ public class Triangle {
public void setEdgesBoundary(boolean[] boundary) {
this.boundaryEdges = boundary;
}
-
+
public boolean[] getEdgeBoundary() {
return boundaryEdges;
}
-
+
public boolean[] getVerticesBoundary() {
return boundaryVertices;
}
@@ -72,7 +72,7 @@ public class Triangle {
public void setVerticesBoundary(boolean[] boundaryVertices) {
this.boundaryVertices = boundaryVertices;
}
-
+
public String toString() {
return "Tri ID: " + id + "\n" + vertices[0] + "\n" + vertices[1] + "\n" + vertices[2];
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
index e3df86de1..40048235e 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
@@ -30,7 +30,7 @@ package com.jogamp.graph.geom;
import com.jogamp.opengl.math.Vert3fImmutable;
/**
- * A Vertex with custom memory layout using custom factory.
+ * A Vertex with custom memory layout using custom factory.
*/
public interface Vertex extends Vert3fImmutable, Cloneable {
@@ -39,16 +39,16 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
T create(float x, float y, float z, boolean onCurve);
- T create(float[] coordsBuffer, int offset, int length, boolean onCurve);
+ T create(float[] coordsBuffer, int offset, int length, boolean onCurve);
}
-
+
void setCoord(float x, float y, float z);
/**
* @see System#arraycopy(Object, int, Object, int, int) for thrown IndexOutOfBoundsException
*/
void setCoord(float[] coordsBuffer, int offset, int length);
-
+
void setX(float x);
void setY(float y);
@@ -60,24 +60,24 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
void setOnCurve(boolean onCurve);
int getId();
-
+
void setId(int id);
-
+
float[] getTexCoord();
-
+
void setTexCoord(float s, float t);
-
+
/**
* @see System#arraycopy(Object, int, Object, int, int) for thrown IndexOutOfBoundsException
*/
void setTexCoord(float[] texCoordsBuffer, int offset, int length);
-
+
/**
* @param obj the Object to compare this Vertex with
- * @return true if {@code obj} is a Vertex and not null, on-curve flag is equal and has same vertex- and tex-coords.
+ * @return true if {@code obj} is a Vertex and not null, on-curve flag is equal and has same vertex- and tex-coords.
*/
boolean equals(Object obj);
-
+
/**
* @return deep clone of this Vertex
*/
diff --git a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
index 97e438b63..6b07688a7 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
@@ -39,11 +39,11 @@ public class SVertex implements Vertex {
protected float[] coord = new float[3];
protected boolean onCurve;
private float[] texCoord = new float[2];
-
+
static final Factory factory = new Factory();
-
- public static Factory factory() { return factory; }
-
+
+ public static Factory factory() { return factory; }
+
public static class Factory implements Vertex.Factory {
public SVertex create() {
return new SVertex();
@@ -55,9 +55,9 @@ public class SVertex implements Vertex {
public SVertex create(float[] coordsBuffer, int offset, int length, boolean onCurve) {
return new SVertex(coordsBuffer, offset, length, onCurve);
- }
+ }
}
-
+
public SVertex() {
}
@@ -65,19 +65,19 @@ public class SVertex implements Vertex {
setCoord(x, y, z);
setOnCurve(onCurve);
}
-
+
public SVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) {
setCoord(coordsBuffer, offset, length);
setOnCurve(onCurve);
}
-
- public SVertex(float[] coordsBuffer, int offset, int length,
+
+ public SVertex(float[] coordsBuffer, int offset, int length,
float[] texCoordsBuffer, int offsetTC, int lengthTC, boolean onCurve) {
setCoord(coordsBuffer, offset, length);
setTexCoord(texCoordsBuffer, offsetTC, lengthTC);
setOnCurve(onCurve);
}
-
+
public final void setCoord(float x, float y, float z) {
this.coord[0] = x;
this.coord[1] = y;
@@ -87,12 +87,12 @@ public class SVertex implements Vertex {
public final void setCoord(float[] coordsBuffer, int offset, int length) {
System.arraycopy(coordsBuffer, offset, coord, 0, length);
}
-
+
@Override
public int getCoordCount() {
return 3;
}
-
+
@Override
public final float[] getCoord() {
return coord;
@@ -133,11 +133,11 @@ public class SVertex implements Vertex {
public final int getId(){
return id;
}
-
+
public final void setId(int id){
this.id = id;
}
-
+
public boolean equals(Object obj) {
if( obj == this) {
return true;
@@ -146,12 +146,12 @@ public class SVertex implements Vertex {
return false;
}
final Vertex v = (Vertex) obj;
- return this == v ||
- isOnCurve() == v.isOnCurve() &&
+ return this == v ||
+ isOnCurve() == v.isOnCurve() &&
VectorUtil.checkEqualityVec2(getTexCoord(), v.getTexCoord()) &&
VectorUtil.checkEquality(getCoord(), v.getCoord()) ;
}
-
+
public final float[] getTexCoord() {
return texCoord;
}
@@ -164,16 +164,16 @@ public class SVertex implements Vertex {
public final void setTexCoord(float[] texCoordsBuffer, int offset, int length) {
System.arraycopy(texCoordsBuffer, offset, texCoord, 0, length);
}
-
+
/**
* @return deep clone of this Vertex, but keeping the id blank
*/
public SVertex clone(){
return new SVertex(this.coord, 0, 3, this.texCoord, 0, 2, this.onCurve);
}
-
+
public String toString() {
- return "[ID: " + id + ", onCurve: " + onCurve +
+ return "[ID: " + id + ", onCurve: " + onCurve +
": p " + coord[0] + ", " + coord[1] + ", " + coord[2] +
", t " + texCoord[0] + ", " + texCoord[1] + "]";
}
diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java
index 7060bb7d1..c78b2b83d 100644
--- a/src/jogl/classes/com/jogamp/opengl/FBObject.java
+++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java
@@ -46,7 +46,7 @@ import com.jogamp.opengl.FBObject.Attachment.Type;
/**
* Core utility class simplifying usage of framebuffer objects (FBO)
- * with all {@link GLProfile}s.
+ * with all {@link GLProfile}s.
*
* Supports on-the-fly reconfiguration of dimension and multisample buffers via {@link #reset(GL, int, int, int, boolean)}
* while preserving the {@link Attachment} references.
@@ -55,50 +55,50 @@ import com.jogamp.opengl.FBObject.Attachment.Type;
* Integrates default read/write framebuffers via {@link GLContext#getDefaultReadFramebuffer()} and {@link GLContext#getDefaultReadFramebuffer()},
* which is being hooked at {@link GL#glBindFramebuffer(int, int)} when the default (zero) framebuffer is selected.
*
- *
+ *
*
FIXME: Implement support for {@link Type#DEPTH_TEXTURE}, {@link Type#STENCIL_TEXTURE} .
*/
public class FBObject {
protected static final boolean DEBUG = Debug.debug("FBObject");
private static final boolean FBOResizeQuirk = false;
-
+
private static enum DetachAction { NONE, DISPOSE, RECREATE };
-
- /**
+
+ /**
* Marker interface, denotes a color buffer attachment.
*
Always an instance of {@link Attachment}.
- *
Either an instance of {@link ColorAttachment} or {@link TextureAttachment}.
+ *
Either an instance of {@link ColorAttachment} or {@link TextureAttachment}.
*/
- public static interface Colorbuffer {
- /**
+ public static interface Colorbuffer {
+ /**
* Initializes the color buffer and set it's parameter, if uninitialized, i.e. name is zero.
* @return true if newly initialized, otherwise false.
- * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case.
+ * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case.
*/
public boolean initialize(GL gl) throws GLException;
-
- /**
+
+ /**
* Releases the color buffer if initialized, i.e. name is not zero.
- * @throws GLException if buffer release fails.
+ * @throws GLException if buffer release fails.
*/
public void free(GL gl) throws GLException;
-
+
/**
* Writes the internal format to the given GLCapabilities object.
* @param caps the destination for format bits
* @param rgba8Avail whether rgba8 is available
*/
- public void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail);
+ public void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail);
}
-
+
/** Common super class of all attachments */
public static abstract class Attachment {
- public enum Type {
+ public enum Type {
NONE, DEPTH, STENCIL, DEPTH_STENCIL, COLOR, COLOR_TEXTURE, DEPTH_TEXTURE, STENCIL_TEXTURE;
-
- /**
+
+ /**
* Returns {@link #COLOR}, {@link #DEPTH}, {@link #STENCIL} or {@link #DEPTH_STENCIL}
- * @throws IllegalArgumentException if format cannot be handled.
+ * @throws IllegalArgumentException if format cannot be handled.
*/
public static Type determine(int format) throws IllegalArgumentException {
switch(format) {
@@ -120,20 +120,20 @@ public class FBObject {
return Type.DEPTH_STENCIL;
default:
throw new IllegalArgumentException("format invalid: "+toHexString(format));
- }
+ }
}
};
-
+
/** immutable type [{@link #COLOR}, {@link #DEPTH}, {@link #STENCIL}, {@link #COLOR_TEXTURE}, {@link #DEPTH_TEXTURE}, {@link #STENCIL_TEXTURE} ] */
public final Type type;
-
+
/** immutable the internal format */
public final int format;
-
+
private int width, height;
-
+
private int name;
-
+
protected Attachment(Type type, int iFormat, int width, int height, int name) {
this.type = type;
this.format = iFormat;
@@ -141,18 +141,18 @@ public class FBObject {
this.height = height;
this.name = name;
}
-
+
/**
* Writes the internal format to the given GLCapabilities object.
* @param caps the destination for format bits
* @param rgba8Avail whether rgba8 is available
*/
- public final void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail) {
+ public final void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail) {
final int _format;
switch(format) {
case GL.GL_RGBA:
case 4:
- _format = rgba8Avail ? GL.GL_RGBA8 : GL.GL_RGBA4;
+ _format = rgba8Avail ? GL.GL_RGBA8 : GL.GL_RGBA4;
break;
case GL.GL_RGB:
case 3:
@@ -191,7 +191,7 @@ public class FBObject {
caps.setGreenBits(8);
caps.setBlueBits(8);
caps.setAlphaBits(8);
- break;
+ break;
case GL.GL_DEPTH_COMPONENT16:
caps.setDepthBits(16);
break;
@@ -218,18 +218,18 @@ public class FBObject {
throw new IllegalArgumentException("format invalid: "+toHexString(format));
}
}
-
+
/** width of attachment */
public final int getWidth() { return width; }
/** height of attachment */
public final int getHeight() { return height; }
/* pp */ final void setSize(int w, int h) { width = w; height = h; }
-
+
/** buffer name [1..max], maybe a texture or renderbuffer name, depending on type. */
- public final int getName() { return name; }
+ public final int getName() { return name; }
/* pp */ final void setName(int n) { name = n; }
-
- /**
+
+ /**
* Initializes the attachment and set it's parameter, if uninitialized, i.e. name is zero.
*
final boolean init = 0 == name;
@@ -239,11 +239,11 @@ public class FBObject {
return init;
*
* @return true if newly initialized, otherwise false.
- * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case.
+ * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case.
*/
public abstract boolean initialize(GL gl) throws GLException;
-
- /**
+
+ /**
* Releases the attachment if initialized, i.e. name is not zero.
*
if(0 != name) {
@@ -251,10 +251,10 @@ public class FBObject {
name = 0;
}
*
- * @throws GLException if buffer release fails.
+ * @throws GLException if buffer release fails.
*/
public abstract void free(GL gl) throws GLException;
-
+
/**
*
* Comparison by {@link #type}, {@link #format}, {@link #width}, {@link #height} and {@link #name}.
@@ -272,7 +272,7 @@ public class FBObject {
height== a.height &&
name == a.name ;
}
-
+
/**
*
* Hashed by {@link #type}, {@link #format}, {@link #width}, {@link #height} and {@link #name}.
@@ -289,14 +289,14 @@ public class FBObject {
hash = ((hash << 5) - hash) + name;
return hash;
}
-
+
int objectHashCode() { return super.hashCode(); }
-
+
public String toString() {
return getClass().getSimpleName()+"[type "+type+", format "+toHexString(format)+", "+width+"x"+height+
"; name "+toHexString(name)+", obj "+toHexString(objectHashCode())+"]";
}
-
+
public static Type getType(int attachmentPoint, int maxColorAttachments) {
if( GL.GL_COLOR_ATTACHMENT0 <= attachmentPoint && attachmentPoint < GL.GL_COLOR_ATTACHMENT0+maxColorAttachments ) {
return Type.COLOR;
@@ -304,9 +304,9 @@ public class FBObject {
switch(attachmentPoint) {
case GL.GL_DEPTH_ATTACHMENT:
return Type.DEPTH;
- case GL.GL_STENCIL_ATTACHMENT:
+ case GL.GL_STENCIL_ATTACHMENT:
return Type.STENCIL;
- default:
+ default:
throw new IllegalArgumentException("Invalid attachment point "+toHexString(attachmentPoint));
}
}
@@ -315,7 +315,7 @@ public class FBObject {
/** Other renderbuffer attachment which maybe a colorbuffer, depth or stencil. */
public static class RenderAttachment extends Attachment {
private int samples;
-
+
/**
* @param type allowed types are {@link Type#DEPTH_STENCIL} {@link Type#DEPTH}, {@link Type#STENCIL} or {@link Type#COLOR}
* @param iFormat
@@ -328,11 +328,11 @@ public class FBObject {
super(validateType(type), iFormat, width, height, name);
this.samples = samples;
}
-
+
/** number of samples, or zero for no multisampling */
public final int getSamples() { return samples; }
/* pp */ final void setSamples(int s) { samples = s; }
-
+
private static Type validateType(Type type) {
switch(type) {
case DEPTH_STENCIL:
@@ -340,11 +340,11 @@ public class FBObject {
case STENCIL:
case COLOR:
return type;
- default:
+ default:
throw new IllegalArgumentException("Invalid type: "+type);
}
}
-
+
/**
*
* Comparison by {@link #type}, {@link #format}, {@link #samples}, {@link #width}, {@link #height} and {@link #name}.
@@ -358,7 +358,7 @@ public class FBObject {
return super.equals(o) &&
samples == ((RenderAttachment)o).samples;
}
-
+
/**
*
* Hashed by {@link #type}, {@link #format}, {@link #samples}, {@link #width}, {@link #height} and {@link #name}.
@@ -378,14 +378,14 @@ public class FBObject {
final boolean init = 0 == getName();
if( init ) {
checkPreGLError(gl);
-
+
final int[] name = new int[] { -1 };
gl.glGenRenderbuffers(1, name, 0);
setName(name[0]);
-
+
gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, getName());
if( samples > 0 ) {
- ((GL2GL3)gl).glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, samples, format, getWidth(), getHeight());
+ ((GL2GL3)gl).glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, samples, format, getWidth(), getHeight());
} else {
gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, format, getWidth(), getHeight());
}
@@ -401,7 +401,7 @@ public class FBObject {
}
return init;
}
-
+
@Override
public void free(GL gl) {
final int[] name = new int[] { getName() };
@@ -413,20 +413,20 @@ public class FBObject {
setName(0);
}
}
-
+
public String toString() {
return getClass().getSimpleName()+"[type "+type+", format "+toHexString(format)+", samples "+samples+", "+getWidth()+"x"+getHeight()+
", name "+toHexString(getName())+", obj "+toHexString(objectHashCode())+"]";
}
}
-
+
/** Color render buffer attachment */
public static class ColorAttachment extends RenderAttachment implements Colorbuffer {
public ColorAttachment(int iFormat, int samples, int width, int height, int name) {
super(Type.COLOR, iFormat, samples, width, height, name);
- }
+ }
}
-
+
/** Texture attachment */
public static class TextureAttachment extends Attachment implements Colorbuffer {
/** details of the texture setup */
@@ -445,7 +445,7 @@ public class FBObject {
* @param wrapT
* @param name
*/
- public TextureAttachment(Type type, int iFormat, int width, int height, int dataFormat, int dataType,
+ public TextureAttachment(Type type, int iFormat, int width, int height, int dataFormat, int dataType,
int magFilter, int minFilter, int wrapS, int wrapT, int name) {
super(validateType(type), iFormat, width, height, name);
this.dataFormat = dataFormat;
@@ -455,35 +455,35 @@ public class FBObject {
this.wrapS = wrapS;
this.wrapT = wrapT;
}
-
+
private static Type validateType(Type type) {
switch(type) {
case COLOR_TEXTURE:
case DEPTH_TEXTURE:
case STENCIL_TEXTURE:
return type;
- default:
+ default:
throw new IllegalArgumentException("Invalid type: "+type);
}
}
-
- /**
+
+ /**
* Initializes the texture and set it's parameter, if uninitialized, i.e. name is zero.
- * @throws GLException if texture generation and setup fails. The just created texture name will be deleted in this case.
+ * @throws GLException if texture generation and setup fails. The just created texture name will be deleted in this case.
*/
@Override
public boolean initialize(GL gl) throws GLException {
final boolean init = 0 == getName();
if( init ) {
checkPreGLError(gl);
-
- final int[] name = new int[] { -1 };
+
+ final int[] name = new int[] { -1 };
gl.glGenTextures(1, name, 0);
if(0 == name[0]) {
throw new GLException("null texture, "+this);
}
setName(name[0]);
-
+
gl.glBindTexture(GL.GL_TEXTURE_2D, name[0]);
if( 0 < magFilter ) {
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, magFilter);
@@ -495,7 +495,7 @@ public class FBObject {
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, wrapS);
}
if( 0 < wrapT ) {
- gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, wrapT);
+ gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, wrapT);
}
boolean preTexImage2D = true;
int glerr = gl.glGetError();
@@ -534,50 +534,50 @@ public class FBObject {
"; min/mag "+toHexString(minFilter)+"/"+toHexString(magFilter)+
", wrap S/T "+toHexString(wrapS)+"/"+toHexString(wrapT)+
"; name "+toHexString(getName())+", obj "+toHexString(objectHashCode())+"]";
- }
+ }
}
static String toHexString(int v) {
return "0x"+Integer.toHexString(v);
}
-
+
/**
- * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE},
+ * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE},
* selecting the texture data type and format automatically.
- *
+ *
*
Using default min/mag filter {@link GL#GL_NEAREST} and default wrapS/wrapT {@link GL#GL_CLAMP_TO_EDGE}.
- *
+ *
* @param glp the chosen {@link GLProfile}
* @param alpha set to true if you request alpha channel, otherwise false;
- * @param width texture width
+ * @param width texture width
* @param height texture height
* @return the created and uninitialized color {@link TextureAttachment}
*/
public static final TextureAttachment createColorTextureAttachment(GLProfile glp, boolean alpha, int width, int height) {
return createColorTextureAttachment(glp, alpha, width, height, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
}
-
+
/**
- * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE},
+ * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE},
* selecting the texture data type and format automatically.
- *
+ *
* @param glp the chosen {@link GLProfile}
* @param alpha set to true if you request alpha channel, otherwise false;
- * @param width texture width
+ * @param width texture width
* @param height texture height
* @param magFilter if > 0 value for {@link GL#GL_TEXTURE_MAG_FILTER}
- * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
+ * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
* @param wrapS if > 0 value for {@link GL#GL_TEXTURE_WRAP_S}
* @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
* @return the created and uninitialized color {@link TextureAttachment}
*/
- public static final TextureAttachment createColorTextureAttachment(GLProfile glp, boolean alpha, int width, int height,
+ public static final TextureAttachment createColorTextureAttachment(GLProfile glp, boolean alpha, int width, int height,
int magFilter, int minFilter, int wrapS, int wrapT) {
final int textureInternalFormat, textureDataFormat, textureDataType;
- if(glp.isGLES()) {
+ if(glp.isGLES()) {
textureInternalFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
textureDataFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
textureDataType = GL.GL_UNSIGNED_BYTE;
- } else {
+ } else {
textureInternalFormat = alpha ? GL.GL_RGBA8 : GL.GL_RGB8;
// textureInternalFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
// textureInternalFormat = alpha ? 4 : 3;
@@ -586,27 +586,27 @@ public class FBObject {
}
return createColorTextureAttachment(textureInternalFormat, width, height, textureDataFormat, textureDataType, magFilter, minFilter, wrapS, wrapT);
}
-
+
/**
- * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE}.
+ * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE}.
*
* @param internalFormat internalFormat parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
- * @param width texture width
+ * @param width texture width
* @param height texture height
* @param dataFormat format parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
* @param dataType type parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
* @param magFilter if > 0 value for {@link GL#GL_TEXTURE_MAG_FILTER}
- * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
+ * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
* @param wrapS if > 0 value for {@link GL#GL_TEXTURE_WRAP_S}
* @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
* @return the created and uninitialized color {@link TextureAttachment}
*/
public static final TextureAttachment createColorTextureAttachment(int internalFormat, int width, int height, int dataFormat, int dataType,
int magFilter, int minFilter, int wrapS, int wrapT) {
- return new TextureAttachment(Type.COLOR_TEXTURE, internalFormat, width, height, dataFormat, dataType,
+ return new TextureAttachment(Type.COLOR_TEXTURE, internalFormat, width, height, dataFormat, dataType,
magFilter, minFilter, wrapS, wrapT, 0 /* name */);
}
-
+
private static boolean hasAlpha(int format) {
switch(format) {
case GL.GL_RGBA8:
@@ -619,7 +619,7 @@ public class FBObject {
return false;
}
}
-
+
private boolean initialized;
private boolean fullFBOSupport;
private boolean rgba8Avail;
@@ -629,7 +629,7 @@ public class FBObject {
private boolean stencil04Avail;
private boolean stencil08Avail;
private boolean stencil16Avail;
- private boolean packedDepthStencilAvail;
+ private boolean packedDepthStencilAvail;
private int maxColorAttachments, maxSamples, maxTextureSize, maxRenderbufferSize;
private int width, height, samples;
@@ -639,21 +639,21 @@ public class FBObject {
private boolean bound;
private int colorAttachmentCount;
- private Colorbuffer[] colorAttachmentPoints; // colorbuffer attachment points
+ private Colorbuffer[] colorAttachmentPoints; // colorbuffer attachment points
private RenderAttachment depth, stencil; // depth and stencil maybe equal in case of packed-depth-stencil
private FBObject samplingSink; // MSAA sink
- private TextureAttachment samplingSinkTexture;
+ private TextureAttachment samplingSinkTexture;
private boolean samplingSinkDirty;
//
// ColorAttachment helper ..
//
-
+
private final void validateColorAttachmentPointRange(int point) {
if(!initialized) {
throw new GLException("FBO not initialized");
- }
+ }
if(maxColorAttachments != colorAttachmentPoints.length) {
throw new InternalError("maxColorAttachments "+maxColorAttachments+", array.lenght "+colorAttachmentPoints);
}
@@ -661,14 +661,14 @@ public class FBObject {
throw new IllegalArgumentException("attachment point out of range: "+point+", should be within [0.."+(maxColorAttachments-1)+"], "+this);
}
}
-
+
private final void validateAddColorAttachment(int point, Colorbuffer ca) {
validateColorAttachmentPointRange(point);
if( null != colorAttachmentPoints[point] ) {
throw new IllegalArgumentException("Cannot attach "+ca+", attachment point already in use by "+colorAttachmentPoints[point]+", "+this);
- }
+ }
}
-
+
private final void addColorAttachment(int point, Colorbuffer ca) {
validateColorAttachmentPointRange(point);
final Colorbuffer c = colorAttachmentPoints[point];
@@ -678,7 +678,7 @@ public class FBObject {
colorAttachmentPoints[point] = ca;
colorAttachmentCount++;
}
-
+
private final void removeColorAttachment(int point, Colorbuffer ca) {
validateColorAttachmentPointRange(point);
final Colorbuffer c = colorAttachmentPoints[point];
@@ -688,20 +688,20 @@ public class FBObject {
colorAttachmentPoints[point] = null;
colorAttachmentCount--;
}
-
+
/**
* Return the {@link Colorbuffer} attachment at attachmentPoint if it is attached to this FBO, otherwise null.
- *
+ *
* @see #attachColorbuffer(GL, boolean)
* @see #attachColorbuffer(GL, boolean)
* @see #attachTexture2D(GL, int, boolean, int, int, int, int)
- * @see #attachTexture2D(GL, int, int, int, int, int, int, int, int)
+ * @see #attachTexture2D(GL, int, int, int, int, int, int, int, int)
*/
public final Colorbuffer getColorbuffer(int attachmentPoint) {
- validateColorAttachmentPointRange(attachmentPoint);
+ validateColorAttachmentPointRange(attachmentPoint);
return colorAttachmentPoints[attachmentPoint];
}
-
+
/**
* Finds the passed {@link Colorbuffer} within the valid range of attachment points
* using reference comparison only.
@@ -709,36 +709,36 @@ public class FBObject {
* Note: Slow. Implementation uses a logN array search to save resources, i.e. not using a HashMap.
*
* @param ca the {@link Colorbuffer} to look for.
- * @return -1 if the {@link Colorbuffer} could not be found, otherwise [0..{@link #getMaxColorAttachments()}-1]
+ * @return -1 if the {@link Colorbuffer} could not be found, otherwise [0..{@link #getMaxColorAttachments()}-1]
*/
public final int getColorbufferAttachmentPoint(Colorbuffer ca) {
for(int i=0; ireference only.
- *
+ *
*
* Note: Slow. Uses {@link #getColorbufferAttachmentPoint(Colorbuffer)} to determine it's attachment point
* to be used for {@link #getColorbuffer(int)}
*
- *
+ *
* @param gl the current GL context
* @param newWidth
* @param newHeight
@@ -911,7 +911,7 @@ public class FBObject {
public final void reset(GL gl, int newWidth, int newHeight) {
reset(gl, newWidth, newHeight, 0, false);
}
-
+
/**
* Initializes or resets this FBO's instance.
*
@@ -920,21 +920,21 @@ public class FBObject {
* to match the new given parameters.
*
*
- * Currently incompatibility and hence recreation of the attachments will be performed
+ * Currently incompatibility and hence recreation of the attachments will be performed
* if the size or sample count doesn't match for subsequent calls.
*
- *
+ *
*
Leaves the FBO bound state untouched
- *
+ *
* @param gl the current GL context
* @param newWidth the new width, it's minimum is capped to 1
* @param newHeight the new height, it's minimum is capped to 1
* @param newSamples if > 0, MSAA will be used, otherwise no multisampling. Will be capped to {@link #getMaxSamples()}.
- * @param resetSamplingSink true calls {@link #resetSamplingSink(GL)} immediatly.
+ * @param resetSamplingSink true calls {@link #resetSamplingSink(GL)} immediatly.
* false postpones resetting the sampling sink until {@link #use(GL, TextureAttachment)} or {@link #syncSamplingSink(GL)},
- * allowing to use the samples sink's FBO and texture until then. The latter is useful to benefit
- * from implicit double buffering while resetting the sink just before it's being used, eg. at swap-buffer.
- *
+ * allowing to use the samples sink's FBO and texture until then. The latter is useful to benefit
+ * from implicit double buffering while resetting the sink just before it's being used, eg. at swap-buffer.
+ *
* @throws GLException in case of an error, i.e. size too big, etc ..
*/
public final void reset(GL gl, int newWidth, int newHeight, int newSamples, boolean resetSamplingSink) {
@@ -942,9 +942,9 @@ public class FBObject {
init(gl, newWidth, newHeight, newSamples);
return;
}
-
+
newSamples = newSamples <= maxSamples ? newSamples : maxSamples; // clamp
-
+
if( newWidth != width || newHeight != height || newSamples != samples ) {
if( 0 >= newWidth ) { newWidth = 1; }
if( 0 >= newHeight ) { newHeight = 1; }
@@ -952,39 +952,39 @@ public class FBObject {
newWidth > maxRenderbufferSize || newHeight > maxRenderbufferSize ) {
throw new GLException("size "+width+"x"+height+" exceeds on of the maxima [texture "+maxTextureSize+", renderbuffer "+maxRenderbufferSize+"]");
}
-
+
if(DEBUG) {
System.err.println("FBObject.reset - START - "+width+"x"+height+", "+samples+" -> "+newWidth+"x"+newHeight+", "+newSamples+"; "+this);
- }
-
+ }
+
final boolean wasBound = isBound();
-
+
width = newWidth;
height = newHeight;
samples = newSamples;
-
+
if(0 < samples && null == samplingSink ) {
// needs valid samplingSink for detach*() -> bind()
samplingSink = new FBObject();
samplingSink.init(gl, width, height, 0);
}
- detachAllImpl(gl, true , true);
+ detachAllImpl(gl, true , true);
if(resetSamplingSink) {
resetSamplingSink(gl);
}
-
+
samplingSinkDirty = true;
if(!wasBound) {
unbind(gl);
}
-
+
if(DEBUG) {
System.err.println("FBObject.reset - END - "+this);
}
- }
+ }
}
-
+
/**
* Writes the internal format of the attachments to the given GLCapabilities object.
* @param caps the destination for format bits
@@ -994,11 +994,11 @@ public class FBObject {
caps.setNumSamples(samples);
caps.setDepthBits(0);
caps.setStencilBits(0);
-
+
final Colorbuffer cb = samples > 0 ? getSamplingSink() : getColorbuffer(0);
if(null != cb) {
cb.formatToGLCapabilities(caps, rgba8Avail);
- }
+ }
if(null != depth) {
depth.formatToGLCapabilities(caps, rgba8Avail);
}
@@ -1006,11 +1006,11 @@ public class FBObject {
stencil.formatToGLCapabilities(caps, rgba8Avail);
}
}
-
- /**
+
+ /**
* Note that the status may reflect an incomplete state during transition of attachments.
* @return The FB status. {@link GL.GL_FRAMEBUFFER_COMPLETE} if ok, otherwise return GL FBO error state or -1
- * @see #validateStatus()
+ * @see #validateStatus()
*/
public final int getStatus() {
return vStatus;
@@ -1020,15 +1020,15 @@ public class FBObject {
public final String getStatusString() {
return getStatusString(vStatus);
}
-
+
public static final String getStatusString(int fbStatus) {
switch(fbStatus) {
case -1:
return "NOT A FBO";
-
+
case GL.GL_FRAMEBUFFER_COMPLETE:
return "OK";
-
+
case GL.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
return("FBO incomplete attachment\n");
case GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
@@ -1043,21 +1043,21 @@ public class FBObject {
return("FBO missing read buffer");
case GL2GL3.GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
return("FBO missing multisample buffer");
- case GL3.GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
+ case GL3.GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
return("FBO missing layer targets");
-
+
case GL.GL_FRAMEBUFFER_UNSUPPORTED:
return("Unsupported FBO format");
case GL2GL3.GL_FRAMEBUFFER_UNDEFINED:
return("FBO undefined");
-
+
case 0:
return("FBO implementation fault");
default:
return("FBO incomplete, implementation ERROR "+toHexString(fbStatus));
}
}
-
+
/**
* The status may even be valid if incomplete during transition of attachments.
* @see #getStatus()
@@ -1066,7 +1066,7 @@ public class FBObject {
switch(vStatus) {
case GL.GL_FRAMEBUFFER_COMPLETE:
return true;
-
+
case GL.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
case GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
case GL.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
@@ -1079,29 +1079,29 @@ public class FBObject {
// we are in transition
return true;
}
-
+
case GL.GL_FRAMEBUFFER_UNSUPPORTED:
case GL2GL3.GL_FRAMEBUFFER_UNDEFINED:
-
- case 0:
+
+ case 0:
default:
if(DEBUG) {
- System.err.println("Framebuffer " + fbName + " is incomplete, status = " + toHexString(vStatus) +
+ System.err.println("Framebuffer " + fbName + " is incomplete, status = " + toHexString(vStatus) +
" : " + getStatusString(vStatus));
}
return false;
}
}
-
+
private static int checkPreGLError(GL gl) {
int glerr = gl.glGetError();
if(DEBUG && GL.GL_NO_ERROR != glerr) {
System.err.println("Pre-existing GL error: "+toHexString(glerr));
Thread.dumpStack();
}
- return glerr;
+ return glerr;
}
-
+
private final boolean checkNoError(GL gl, int err, String exceptionMessage) throws GLException {
if(GL.GL_NO_ERROR != err) {
if(null != gl) {
@@ -1118,17 +1118,17 @@ public class FBObject {
private final void checkInitialized() throws GLException {
if(!initialized) {
throw new GLException("FBO not initialized, call init(GL) first.");
- }
+ }
}
-
+
/**
* Attaches a {@link Colorbuffer}, i.e. {@link TextureAttachment}, to this FBO's instance at the given attachment point,
* selecting the texture data type and format automatically.
- *
+ *
*
Using default min/mag filter {@link GL#GL_NEAREST} and default wrapS/wrapT {@link GL#GL_CLAMP_TO_EDGE}.
- *
+ *
*
Leaves the FBO bound.
- *
+ *
* @param gl the current GL context
* @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
* @param alpha set to true if you request alpha channel, otherwise false;
@@ -1140,18 +1140,18 @@ public class FBObject {
return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
createColorTextureAttachment(gl.getGLProfile(), alpha, width, height));
}
-
+
/**
* Attaches a {@link Colorbuffer}, i.e. {@link TextureAttachment}, to this FBO's instance at the given attachment point,
* selecting the texture data type and format automatically.
- *
+ *
*
Leaves the FBO bound.
- *
+ *
* @param gl the current GL context
* @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
* @param alpha set to true if you request alpha channel, otherwise false;
* @param magFilter if > 0 value for {@link GL#GL_TEXTURE_MAG_FILTER}
- * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
+ * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
* @param wrapS if > 0 value for {@link GL#GL_TEXTURE_WRAP_S}
* @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
* @return TextureAttachment instance describing the new attached texture colorbuffer if bound and configured successfully, otherwise GLException is thrown
@@ -1162,19 +1162,19 @@ public class FBObject {
return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
createColorTextureAttachment(gl.getGLProfile(), alpha, width, height, magFilter, minFilter, wrapS, wrapT));
}
-
+
/**
* Attaches a {@link Colorbuffer}, i.e. {@link TextureAttachment}, to this FBO's instance at the given attachment point.
- *
+ *
*
Leaves the FBO bound.
- *
+ *
* @param gl the current GL context
* @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
* @param internalFormat internalFormat parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
* @param dataFormat format parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
* @param dataType type parameter to {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long)}
* @param magFilter if > 0 value for {@link GL#GL_TEXTURE_MAG_FILTER}
- * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
+ * @param minFilter if > 0 value for {@link GL#GL_TEXTURE_MIN_FILTER}
* @param wrapS if > 0 value for {@link GL#GL_TEXTURE_WRAP_S}
* @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
* @return TextureAttachment instance describing the new attached texture colorbuffer if bound and configured successfully, otherwise GLException is thrown
@@ -1187,10 +1187,10 @@ public class FBObject {
return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
createColorTextureAttachment(internalFormat, width, height, dataFormat, dataType, magFilter, minFilter, wrapS, wrapT));
}
-
+
/**
* Creates a {@link ColorAttachment}, selecting the format automatically.
- *
+ *
* @param alpha set to true if you request alpha channel, otherwise false;
* @return uninitialized ColorAttachment instance describing the new attached colorbuffer
*/
@@ -1203,13 +1203,13 @@ public class FBObject {
}
return new ColorAttachment(internalFormat, samples, width, height, 0);
}
-
+
/**
* Attaches a {@link Colorbuffer}, i.e. {@link ColorAttachment}, to this FBO's instance at the given attachment point,
* selecting the format automatically.
- *
+ *
*
Leaves the FBO bound.
- *
+ *
* @param gl the current GL context
* @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
* @param alpha set to true if you request alpha channel, otherwise false;
@@ -1220,15 +1220,15 @@ public class FBObject {
public final ColorAttachment attachColorbuffer(GL gl, int attachmentPoint, boolean alpha) throws GLException {
return (ColorAttachment) attachColorbuffer(gl, attachmentPoint, createColorAttachment(alpha));
}
-
+
/**
* Attaches a {@link Colorbuffer}, i.e. {@link ColorAttachment}, to this FBO's instance at the given attachment point.
- *
+ *
*
Leaves the FBO bound.
- *
+ *
* @param gl the current GL context
* @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
- * @param internalFormat usually {@link GL#GL_RGBA4}, {@link GL#GL_RGB5_A1}, {@link GL#GL_RGB565}, {@link GL#GL_RGB8} or {@link GL#GL_RGBA8}
+ * @param internalFormat usually {@link GL#GL_RGBA4}, {@link GL#GL_RGB5_A1}, {@link GL#GL_RGB565}, {@link GL#GL_RGB8} or {@link GL#GL_RGBA8}
* @return ColorAttachment instance describing the new attached colorbuffer if bound and configured successfully, otherwise GLException is thrown
* @throws GLException in case the colorbuffer couldn't be allocated
* @throws IllegalArgumentException if internalFormat doesn't reflect a colorbuffer
@@ -1238,28 +1238,28 @@ public class FBObject {
if( Attachment.Type.COLOR != atype ) {
throw new IllegalArgumentException("colorformat invalid: "+toHexString(internalFormat)+", "+this);
}
-
+
return (ColorAttachment) attachColorbuffer(gl, attachmentPoint, new ColorAttachment(internalFormat, samples, width, height, 0));
}
-
+
/**
- * Attaches a {@link Colorbuffer}, i.e. {@link ColorAttachment} or {@link TextureAttachment},
+ * Attaches a {@link Colorbuffer}, i.e. {@link ColorAttachment} or {@link TextureAttachment},
* to this FBO's instance at the given attachment point.
- *
+ *
*
* If {@link Colorbuffer} is a {@link TextureAttachment} and is uninitialized, i.e. it's texture name is zero,
* a new texture name is generated and setup w/ the texture parameter.
* Otherwise, i.e. texture name is not zero, the passed TextureAttachment texA is
- * considered complete and assumed matching this FBO requirement. A GL error may occur is the latter is untrue.
+ * considered complete and assumed matching this FBO requirement. A GL error may occur is the latter is untrue.
*
- *
+ *
*
Leaves the FBO bound.
- *
+ *
* @param gl
* @param attachmentPoint the color attachment point ranging from [0..{@link #getMaxColorAttachments()}-1]
- * @param colbuf the to be attached {@link Colorbuffer}
+ * @param colbuf the to be attached {@link Colorbuffer}
* @return newly attached {@link Colorbuffer} instance if bound and configured successfully, otherwise GLException is thrown
- * @throws GLException in case the colorbuffer couldn't be allocated or MSAA has been chosen in case of a {@link TextureAttachment}
+ * @throws GLException in case the colorbuffer couldn't be allocated or MSAA has been chosen in case of a {@link TextureAttachment}
*/
public final Colorbuffer attachColorbuffer(GL gl, int attachmentPoint, Colorbuffer colbuf) throws GLException {
bind(gl);
@@ -1268,13 +1268,13 @@ public class FBObject {
private final Colorbuffer attachColorbufferImpl(GL gl, int attachmentPoint, Colorbuffer colbuf) throws GLException {
validateAddColorAttachment(attachmentPoint, colbuf);
-
+
final boolean initializedColorbuf = colbuf.initialize(gl);
addColorAttachment(attachmentPoint, colbuf);
-
+
if(colbuf instanceof TextureAttachment) {
final TextureAttachment texA = (TextureAttachment) colbuf;
-
+
if(samples>0) {
removeColorAttachment(attachmentPoint, texA);
if(initializedColorbuf) {
@@ -1282,14 +1282,14 @@ public class FBObject {
}
throw new GLException("Texture2D not supported w/ MSAA. If you have enabled MSAA with exisiting texture attachments, you may want to detach them via detachAllTexturebuffer(gl).");
}
-
+
// Set up the color buffer for use as a renderable texture:
gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER,
GL.GL_COLOR_ATTACHMENT0 + attachmentPoint,
GL.GL_TEXTURE_2D, texA.getName(), 0);
-
+
if(!ignoreStatus) {
- updateStatus(gl);
+ updateStatus(gl);
if(!isStatusValid()) {
detachColorbuffer(gl, attachmentPoint, true);
throw new GLException("attachTexture2D "+texA+" at "+attachmentPoint+" failed "+getStatusString()+", "+this);
@@ -1297,12 +1297,12 @@ public class FBObject {
}
} else if(colbuf instanceof ColorAttachment) {
final ColorAttachment colA = (ColorAttachment) colbuf;
-
+
// Attach the color buffer
- gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
- GL.GL_COLOR_ATTACHMENT0 + attachmentPoint,
+ gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
+ GL.GL_COLOR_ATTACHMENT0 + attachmentPoint,
GL.GL_RENDERBUFFER, colA.getName());
-
+
if(!ignoreStatus) {
updateStatus(gl);
if(!isStatusValid()) {
@@ -1316,7 +1316,7 @@ public class FBObject {
}
return colbuf;
}
-
+
/**
* Attaches one depth, stencil or packed-depth-stencil buffer to this FBO's instance,
* selecting the internalFormat automatically.
@@ -1325,30 +1325,30 @@ public class FBObject {
*
*
* In case the desired type or bit-number is not supported, the next available one is chosen.
- *
+ *
*
* Use {@link #getDepthAttachment()} and/or {@link #getStencilAttachment()} to retrieve details
* about the attached buffer. The details cannot be returned, since it's possible 2 buffers
* are being created, depth and stencil.
*
- *
+ *
*
Leaves the FBO bound.
- *
+ *
* @param gl
- * @param atype either {@link Type#DEPTH}, {@link Type#STENCIL} or {@link Type#DEPTH_STENCIL}
+ * @param atype either {@link Type#DEPTH}, {@link Type#STENCIL} or {@link Type#DEPTH_STENCIL}
* @param reqBits desired bits for depth or -1 for default (24 bits)
* @throws GLException in case the renderbuffer couldn't be allocated or one is already attached.
* @throws IllegalArgumentException
* @see #getDepthAttachment()
* @see #getStencilAttachment()
*/
- public final void attachRenderbuffer(GL gl, Attachment.Type atype, int reqBits) throws GLException, IllegalArgumentException {
+ public final void attachRenderbuffer(GL gl, Attachment.Type atype, int reqBits) throws GLException, IllegalArgumentException {
if( 0 > reqBits ) {
reqBits = 24;
- }
+ }
final int internalFormat;
int internalStencilFormat = -1;
-
+
switch ( atype ) {
case DEPTH:
if( 32 <= reqBits && depth32Avail ) {
@@ -1356,10 +1356,10 @@ public class FBObject {
} else if( 24 <= reqBits && depth24Avail ) {
internalFormat = GL.GL_DEPTH_COMPONENT24;
} else {
- internalFormat = GL.GL_DEPTH_COMPONENT16;
+ internalFormat = GL.GL_DEPTH_COMPONENT16;
}
break;
-
+
case STENCIL:
if( 16 <= reqBits && stencil16Avail ) {
internalFormat = GL2GL3.GL_STENCIL_INDEX16;
@@ -1370,10 +1370,10 @@ public class FBObject {
} else if( 1 <= reqBits && stencil01Avail ) {
internalFormat = GL.GL_STENCIL_INDEX1;
} else {
- throw new GLException("stencil buffer n/a");
+ throw new GLException("stencil buffer n/a");
}
break;
-
+
case DEPTH_STENCIL:
if( packedDepthStencilAvail ) {
internalFormat = GL.GL_DEPTH24_STENCIL8;
@@ -1381,7 +1381,7 @@ public class FBObject {
if( 24 <= reqBits && depth24Avail ) {
internalFormat = GL.GL_DEPTH_COMPONENT24;
} else {
- internalFormat = GL.GL_DEPTH_COMPONENT16;
+ internalFormat = GL.GL_DEPTH_COMPONENT16;
}
if( stencil08Avail ) {
internalStencilFormat = GL.GL_STENCIL_INDEX8;
@@ -1397,17 +1397,17 @@ public class FBObject {
default:
throw new IllegalArgumentException("only depth/stencil types allowed, was "+atype+", "+this);
}
-
+
attachRenderbufferImpl(gl, atype, internalFormat);
-
+
if(0<=internalStencilFormat) {
attachRenderbufferImpl(gl, Attachment.Type.STENCIL, internalStencilFormat);
}
}
-
+
/**
* Attaches one depth, stencil or packed-depth-stencil buffer to this FBO's instance,
- * depending on the internalFormat.
+ * depending on the internalFormat.
*
* Stencil and depth buffer can be attached only once.
*
@@ -1416,9 +1416,9 @@ public class FBObject {
* about the attached buffer. The details cannot be returned, since it's possible 2 buffers
* are being created, depth and stencil.
*
- *
+ *
*
- *
+ *
* @param gl
* @param attachmentPoint
* @param dispose true if the Colorbuffer shall be disposed
@@ -1515,26 +1515,26 @@ public class FBObject {
*/
public final Colorbuffer detachColorbuffer(GL gl, int attachmentPoint, boolean dispose) throws IllegalArgumentException {
bind(gl);
-
+
final Colorbuffer res = detachColorbufferImpl(gl, attachmentPoint, dispose ? DetachAction.DISPOSE : DetachAction.NONE);
if(null == res) {
- throw new IllegalArgumentException("ColorAttachment at "+attachmentPoint+", not attached, "+this);
+ throw new IllegalArgumentException("ColorAttachment at "+attachmentPoint+", not attached, "+this);
}
if(DEBUG) {
System.err.println("FBObject.detachColorbuffer.X: [attachmentPoint "+attachmentPoint+", dispose "+dispose+"]: "+res+", "+this);
}
return res;
}
-
+
private final Colorbuffer detachColorbufferImpl(GL gl, int attachmentPoint, DetachAction detachAction) {
Colorbuffer colbuf = colorAttachmentPoints[attachmentPoint]; // shortcut, don't validate here
-
+
if(null == colbuf) {
return null;
}
-
+
removeColorAttachment(attachmentPoint, colbuf);
-
+
if(colbuf instanceof TextureAttachment) {
final TextureAttachment texA = (TextureAttachment) colbuf;
if( 0 != texA.getName() ) {
@@ -1553,7 +1553,7 @@ public class FBObject {
if(DetachAction.RECREATE == detachAction) {
if(samples == 0) {
// stay non MSAA
- texA.setSize(width, height);
+ texA.setSize(width, height);
} else {
// switch to MSAA
colbuf = createColorAttachment(hasAlpha(texA.format));
@@ -1563,8 +1563,8 @@ public class FBObject {
} else if(colbuf instanceof ColorAttachment) {
final ColorAttachment colA = (ColorAttachment) colbuf;
if( 0 != colA.getName() ) {
- gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
- GL.GL_COLOR_ATTACHMENT0+attachmentPoint,
+ gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
+ GL.GL_COLOR_ATTACHMENT0+attachmentPoint,
GL.GL_RENDERBUFFER, 0);
switch(detachAction) {
case DISPOSE:
@@ -1582,9 +1582,9 @@ public class FBObject {
} else {
// switch to non MSAA
if(null != samplingSinkTexture) {
- colbuf = createColorTextureAttachment(samplingSinkTexture.format, width, height,
- samplingSinkTexture.dataFormat, samplingSinkTexture.dataType,
- samplingSinkTexture.magFilter, samplingSinkTexture.minFilter,
+ colbuf = createColorTextureAttachment(samplingSinkTexture.format, width, height,
+ samplingSinkTexture.dataFormat, samplingSinkTexture.dataType,
+ samplingSinkTexture.magFilter, samplingSinkTexture.minFilter,
samplingSinkTexture.wrapS, samplingSinkTexture.wrapT);
} else {
colbuf = createColorTextureAttachment(gl.getGLProfile(), true, width, height);
@@ -1595,15 +1595,15 @@ public class FBObject {
}
return colbuf;
}
-
+
private final void freeAllColorbufferImpl(GL gl) {
for(int i=0; iLeaves the FBO bound, if initialized!
*
* An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
- *
+ *
* @param gl the current GL context
*/
public final void detachAll(GL gl) {
if(null != samplingSink) {
samplingSink.detachAll(gl);
- }
+ }
detachAllImpl(gl, true/* detachNonColorbuffer */, false /* recreate */);
}
-
- /**
- * Detaches all {@link ColorAttachment}s and {@link TextureAttachment}s
+
+ /**
+ * Detaches all {@link ColorAttachment}s and {@link TextureAttachment}s
* and disposes them.
*
Leaves the FBO bound, if initialized!
*
* An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
- *
+ *
* @param gl the current GL context
*/
public final void detachAllColorbuffer(GL gl) {
if(null != samplingSink) {
samplingSink.detachAllColorbuffer(gl);
- }
+ }
detachAllImpl(gl, false/* detachNonColorbuffer */, false /* recreate */);
}
-
- /**
+
+ /**
* Detaches all {@link TextureAttachment}s and disposes them.
*
Leaves the FBO bound, if initialized!
*
* An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
- *
+ *
* @param gl the current GL context
*/
public final void detachAllTexturebuffer(GL gl) {
@@ -1826,7 +1826,7 @@ public class FBObject {
if(null != samplingSink) {
samplingSink.detachAllTexturebuffer(gl);
}
- bind(gl);
+ bind(gl);
for(int i=0; i0 ) {
throw new InternalError("Non zero ColorAttachments "+this);
}
-
+
if(detachNonColorbuffer) {
detachRenderbufferImpl(gl, Attachment.Type.DEPTH_STENCIL, recreate ? DetachAction.RECREATE : DetachAction.DISPOSE);
}
@@ -1888,7 +1888,7 @@ public class FBObject {
System.err.println("FBObject.detachAll.X: [resetNonColorbuffer "+detachNonColorbuffer+", recreate "+recreate+"]: "+this);
}
}
-
+
/**
* @param gl the current GL context
*/
@@ -1903,9 +1903,9 @@ public class FBObject {
if( null != samplingSink && samplingSink.isInitialized() ) {
samplingSink.destroy(gl);
}
-
+
detachAllImpl(gl, true /* detachNonColorbuffer */, false /* recreate */);
-
+
// cache FB names, preset exposed to zero,
// braking ties w/ GL/GLContext link to getReadFramebuffer()/getWriteFramebuffer()
final int fb_cache = fbName;
@@ -1915,7 +1915,7 @@ public class FBObject {
if(0!=fb_cache) {
name[0] = fb_cache;
gl.glDeleteFramebuffers(1, name, 0);
- }
+ }
initialized = false;
bound = false;
if(DEBUG) {
@@ -1933,14 +1933,14 @@ public class FBObject {
final boolean depthMismatch = ( null != depth && null == samplingSink.depth ) ||
( null != depth && null != samplingSink.depth &&
depth.format != samplingSink.depth.format );
-
+
final boolean stencilMismatch = ( null != stencil && null == samplingSink.stencil ) ||
( null != stencil && null != samplingSink.stencil &&
- stencil.format != samplingSink.stencil.format );
-
- return depthMismatch || stencilMismatch;
+ stencil.format != samplingSink.stencil.format );
+
+ return depthMismatch || stencilMismatch;
}
-
+
/**
* Manually reset the MSAA sampling sink, if used.
*
@@ -1948,7 +1948,7 @@ public class FBObject {
* a new sampling sink is being created.
*
*
- * Automatically called by {@link #reset(GL, int, int, int, boolean)}
+ * Automatically called by {@link #reset(GL, int, int, int, boolean)}
* and {@link #syncSamplingSink(GL)}.
*
*
@@ -1967,58 +1967,58 @@ public class FBObject {
}
return;
}
-
+
if(null == samplingSink ) {
samplingSink = new FBObject();
}
-
+
if(!samplingSink.initialized) {
samplingSink.init(gl, width, height, 0);
}
-
+
boolean sampleSinkSizeMismatch = sampleSinkSizeMismatch();
boolean sampleSinkTexMismatch = sampleSinkTexMismatch();
boolean sampleSinkDepthStencilMismatch = sampleSinkDepthStencilMismatch();
-
+
/** if(DEBUG) {
System.err.println("FBObject.resetSamplingSink.0: \n\tTHIS "+this+",\n\tSINK "+samplesSink+
"\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
} */
-
+
if(!sampleSinkSizeMismatch && !sampleSinkTexMismatch && !sampleSinkDepthStencilMismatch) {
- // all properties match ..
- return;
+ // all properties match ..
+ return;
}
-
+
unbind(gl);
-
+
if(DEBUG) {
System.err.println("FBObject.resetSamplingSink: BEGIN\n\tTHIS "+this+",\n\tSINK "+samplingSink+
"\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
}
-
+
if( sampleSinkDepthStencilMismatch ) {
samplingSink.detachAllRenderbuffer(gl);
}
-
+
if( sampleSinkSizeMismatch ) {
samplingSink.reset(gl, width, height);
}
-
+
if(null == samplingSinkTexture) {
samplingSinkTexture = samplingSink.attachTexture2D(gl, 0, true);
} else if( 0 == samplingSinkTexture.getName() ) {
samplingSinkTexture.setSize(width, height);
samplingSink.attachColorbuffer(gl, 0, samplingSinkTexture);
}
-
+
if( sampleSinkDepthStencilMismatch ) {
samplingSink.attachRenderbuffer(gl, depth.format);
if( null != stencil && !isDepthStencilPackedFormat() ) {
samplingSink.attachRenderbuffer(gl, stencil.format);
}
- }
-
+ }
+
sampleSinkSizeMismatch = sampleSinkSizeMismatch();
sampleSinkTexMismatch = sampleSinkTexMismatch();
sampleSinkDepthStencilMismatch = sampleSinkDepthStencilMismatch();
@@ -2026,21 +2026,21 @@ public class FBObject {
throw new InternalError("Samples sink mismatch after reset: \n\tTHIS "+this+",\n\t SINK "+samplingSink+
"\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
}
-
+
if(DEBUG) {
System.err.println("FBObject.resetSamplingSink: END\n\tTHIS "+this+",\n\tSINK "+samplingSink+
"\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
}
}
-
+
/**
* Setting this FBO sampling sink.
* @param newSamplingSink the new FBO sampling sink to use, or null to remove current sampling sink
- * @return the previous sampling sink or null if none was attached
+ * @return the previous sampling sink or null if none was attached
* @throws GLException if this FBO doesn't use MSAA or the given sink uses MSAA itself
*/
public FBObject setSamplingSink(FBObject newSamplingSink) throws GLException {
- final FBObject prev = samplingSink;
+ final FBObject prev = samplingSink;
if( null == newSamplingSink) {
samplingSink = null;
samplingSinkTexture = null;
@@ -2056,14 +2056,14 @@ public class FBObject {
samplingSinkDirty = true;
return prev;
}
-
- /**
+
+ /**
* Bind this FBO, i.e. bind write framebuffer to {@link #getWriteFramebuffer()}.
- *
- *
If multisampling is used, it sets the read framebuffer to the sampling sink {@link #getWriteFramebuffer()},
+ *
+ *
If multisampling is used, it sets the read framebuffer to the sampling sink {@link #getWriteFramebuffer()},
* if full FBO is supported.
- *
- *
+ *
+ *
* In case you have attached more than one color buffer,
* you may want to setup {@link GL2GL3#glDrawBuffers(int, int[], int)}.
*
@@ -2079,7 +2079,7 @@ public class FBObject {
gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, getReadFramebuffer());
} else {
// one for all
- gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, getWriteFramebuffer());
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, getWriteFramebuffer());
}
bound = true;
@@ -2087,29 +2087,29 @@ public class FBObject {
}
}
- /**
+ /**
* Unbind this FBO, i.e. bind read and write framebuffer to default, see {@link GLBase#getDefaultDrawFramebuffer()}.
- *
- *
If full FBO is supported, sets the read and write framebuffer individually to default, hence not disturbing
+ *
+ *
If full FBO is supported, sets the read and write framebuffer individually to default, hence not disturbing
* an optional operating MSAA FBO, see {@link GLBase#getDefaultReadFramebuffer()} and {@link GLBase#getDefaultDrawFramebuffer()}
- *
+ *
* @param gl the current GL context
* @throws GLException
*/
public final void unbind(GL gl) throws GLException {
if(bound) {
if(fullFBOSupport) {
- // default read/draw buffers, may utilize GLContext/GLDrawable override of
+ // default read/draw buffers, may utilize GLContext/GLDrawable override of
// GLContext.getDefaultDrawFramebuffer() and GLContext.getDefaultReadFramebuffer()
gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, 0);
gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, 0);
} else {
- gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0); // default draw buffer
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0); // default draw buffer
}
bound = false;
}
}
-
+
/**
* Method simply marks this FBO unbound w/o interfering w/ the bound framebuffer as perfomed by {@link #unbind(GL)}.
*
@@ -2121,22 +2121,22 @@ public class FBObject {
bound = false;
}
- /**
+ /**
* Returns true if framebuffer object is bound via {@link #bind(GL)}, otherwise false.
*
* Method verifies the bound state via {@link GL#getBoundFramebuffer(int)}.
*
* @param gl the current GL context
*/
- public final boolean isBound(GL gl) {
+ public final boolean isBound(GL gl) {
bound = bound && fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER) ;
return bound;
}
-
+
/** Returns true if framebuffer object is bound via {@link #bind(GL)}, otherwise false. */
public final boolean isBound() { return bound; }
-
- /**
+
+ /**
* If multisampling is being used and flagged dirty by a previous call of {@link #bind(GL)} or after initialization,
* the msaa-buffers are sampled to it's sink {@link #getSamplingSink()}.
*
@@ -2147,7 +2147,7 @@ public class FBObject {
*
*
* Method always resets the framebuffer binding to default in the end.
- * If full FBO is supported, sets the read and write framebuffer individually to default after sampling, hence not disturbing
+ * If full FBO is supported, sets the read and write framebuffer individually to default after sampling, hence not disturbing
* an optional operating MSAA FBO, see {@link GLBase#getDefaultReadFramebuffer()} and {@link GLBase#getDefaultDrawFramebuffer()}
*
*
@@ -2155,10 +2155,10 @@ public class FBObject {
* you may want to call {@link GL#glBindFramebuffer(int, int) glBindFramebuffer}({@link GL2GL3#GL_READ_FRAMEBUFFER}, {@link #getReadFramebuffer()});
*
*
Leaves the FBO unbound.
- *
+ *
* @param gl the current GL context
* @param ta {@link TextureAttachment} to use, prev. attached w/ {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)}
- * @throws IllegalArgumentException
+ * @throws IllegalArgumentException
*/
public final void syncSamplingSink(GL gl) {
markUnbound();
@@ -2170,30 +2170,30 @@ public class FBObject {
gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, samplingSink.getWriteFramebuffer());
((GL2GL3)gl).glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, // since MSAA is supported, casting to GL2GL3 is OK
GL.GL_COLOR_BUFFER_BIT, GL.GL_NEAREST);
- checkNoError(null, gl.glGetError(), "FBObject syncSampleSink"); // throws GLException if error
+ checkNoError(null, gl.glGetError(), "FBObject syncSampleSink"); // throws GLException if error
}
if(fullFBOSupport) {
- // default read/draw buffers, may utilize GLContext/GLDrawable override of
+ // default read/draw buffers, may utilize GLContext/GLDrawable override of
// GLContext.getDefaultDrawFramebuffer() and GLContext.getDefaultReadFramebuffer()
gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, 0);
gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, 0);
} else {
- gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0); // default draw buffer
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0); // default draw buffer
}
}
-
- /**
+
+ /**
* Bind the given texture colorbuffer.
- *
+ *
*
If using multiple texture units, ensure you call {@link GL#glActiveTexture(int)} first!
- *
+ *
*
{@link #syncSamplingSink(GL)} is being called
- *
+ *
*
Leaves the FBO unbound!
- *
+ *
* @param gl the current GL context
* @param ta {@link TextureAttachment} to use, prev. attached w/ {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)}
- * @throws IllegalArgumentException
+ * @throws IllegalArgumentException
*/
public final void use(GL gl, TextureAttachment ta) throws IllegalArgumentException {
if(null == ta) { throw new IllegalArgumentException("Null TextureAttachment, this: "+toString()); }
@@ -2201,26 +2201,26 @@ public class FBObject {
gl.glBindTexture(GL.GL_TEXTURE_2D, ta.getName()); // use it ..
}
- /**
+ /**
* Unbind texture, ie bind 'non' texture 0
- *
+ *
*
Leaves the FBO unbound.
- */
+ */
public final void unuse(GL gl) {
unbind(gl);
gl.glBindTexture(GL.GL_TEXTURE_2D, 0); // don't use it
}
- /** @see GL#hasFullFBOSupport() */
+ /** @see GL#hasFullFBOSupport() */
public final boolean hasFullFBOSupport() throws GLException { checkInitialized(); return this.fullFBOSupport; }
-
- /**
+
+ /**
* Returns true if renderbuffer accepts internal format {@link GL#GL_RGB8} and {@link GL#GL_RGBA8}, otherwise false.
* @throws GLException if {@link #init(GL)} hasn't been called.
*/
public final boolean supportsRGBA8() throws GLException { checkInitialized(); return rgba8Avail; }
-
- /**
+
+ /**
* Returns true if {@link GL#GL_DEPTH_COMPONENT16}, {@link GL#GL_DEPTH_COMPONENT24} or {@link GL#GL_DEPTH_COMPONENT32} is supported, otherwise false.
* @param bits 16, 24 or 32 bits
* @throws GLException if {@link #init(GL)} hasn't been called.
@@ -2228,14 +2228,14 @@ public class FBObject {
public final boolean supportsDepth(int bits) throws GLException {
checkInitialized();
switch(bits) {
- case 16: return true;
+ case 16: return true;
case 24: return depth24Avail;
case 32: return depth32Avail;
- default: return false;
+ default: return false;
}
}
-
- /**
+
+ /**
* Returns true if {@link GL#GL_STENCIL_INDEX1}, {@link GL#GL_STENCIL_INDEX4}, {@link GL#GL_STENCIL_INDEX8} or {@link GL2GL3#GL_STENCIL_INDEX16} is supported, otherwise false.
* @param bits 1, 4, 8 or 16 bits
* @throws GLException if {@link #init(GL)} hasn't been called.
@@ -2243,34 +2243,34 @@ public class FBObject {
public final boolean supportsStencil(int bits) throws GLException {
checkInitialized();
switch(bits) {
- case 1: return stencil01Avail;
+ case 1: return stencil01Avail;
case 4: return stencil04Avail;
case 8: return stencil08Avail;
case 16: return stencil16Avail;
- default: return false;
+ default: return false;
}
}
-
- /**
+
+ /**
* Returns true if {@link GL#GL_DEPTH24_STENCIL8} is supported, otherwise false.
* @throws GLException if {@link #init(GL)} hasn't been called.
*/
public final boolean supportsPackedDepthStencil() throws GLException { checkInitialized(); return packedDepthStencilAvail; }
-
+
/**
* Returns the maximum number of colorbuffer attachments.
* @throws GLException if {@link #init(GL)} hasn't been called.
*/
public final int getMaxColorAttachments() throws GLException { checkInitialized(); return maxColorAttachments; }
-
+
public final int getMaxTextureSize() throws GLException { checkInitialized(); return this.maxTextureSize; }
public final int getMaxRenderbufferSize() throws GLException { checkInitialized(); return this.maxRenderbufferSize; }
-
+
/** @see GL#getMaxRenderbufferSamples() */
public final int getMaxSamples() throws GLException { checkInitialized(); return this.maxSamples; }
-
+
/**
- * Returns true if this instance has been initialized with {@link #reset(GL, int, int)}
+ * Returns true if this instance has been initialized with {@link #reset(GL, int, int)}
* or {@link #reset(GL, int, int, int, boolean)}, otherwise false
*/
public final boolean isInitialized() { return initialized; }
@@ -2283,43 +2283,43 @@ public class FBObject {
/** Returns the framebuffer name to render to. */
public final int getWriteFramebuffer() { return fbName; }
/** Returns the framebuffer name to read from. Depending on multisampling, this may be a different framebuffer. */
- public final int getReadFramebuffer() { return ( samples > 0 ) ? samplingSink.getReadFramebuffer() : fbName; }
- public final int getDefaultReadBuffer() { return GL.GL_COLOR_ATTACHMENT0; }
+ public final int getReadFramebuffer() { return ( samples > 0 ) ? samplingSink.getReadFramebuffer() : fbName; }
+ public final int getDefaultReadBuffer() { return GL.GL_COLOR_ATTACHMENT0; }
/** Return the number of color/texture attachments */
public final int getColorAttachmentCount() { return colorAttachmentCount; }
- /** Return the stencil {@link RenderAttachment} attachment, if exist. Maybe share the same {@link Attachment#getName()} as {@link #getDepthAttachment()}, if packed depth-stencil is being used. */
+ /** Return the stencil {@link RenderAttachment} attachment, if exist. Maybe share the same {@link Attachment#getName()} as {@link #getDepthAttachment()}, if packed depth-stencil is being used. */
public final RenderAttachment getStencilAttachment() { return stencil; }
- /** Return the depth {@link RenderAttachment} attachment. Maybe share the same {@link Attachment#getName()} as {@link #getStencilAttachment()}, if packed depth-stencil is being used. */
+ /** Return the depth {@link RenderAttachment} attachment. Maybe share the same {@link Attachment#getName()} as {@link #getStencilAttachment()}, if packed depth-stencil is being used. */
public final RenderAttachment getDepthAttachment() { return depth; }
-
- /** Return the complete multisampling {@link FBObject} sink, if using multisampling. */
+
+ /** Return the complete multisampling {@link FBObject} sink, if using multisampling. */
public final FBObject getSamplingSinkFBO() { return samplingSink; }
-
- /** Return the multisampling {@link TextureAttachment} sink, if using multisampling. */
+
+ /** Return the multisampling {@link TextureAttachment} sink, if using multisampling. */
public final TextureAttachment getSamplingSink() { return samplingSinkTexture; }
- /**
- * Returns true if the multisampling colorbuffer (msaa-buffer)
+ /**
+ * Returns true if the multisampling colorbuffer (msaa-buffer)
* has been flagged dirty by a previous call of {@link #bind(GL)},
* otherwise false.
*/
public final boolean isSamplingBufferDirty() { return samplingSinkDirty; }
-
+
int objectHashCode() { return super.hashCode(); }
-
+
public final String toString() {
- final String caps = null != colorAttachmentPoints ? Arrays.asList(colorAttachmentPoints).toString() : null ;
+ final String caps = null != colorAttachmentPoints ? Arrays.asList(colorAttachmentPoints).toString() : null ;
return "FBO[name r/w "+fbName+"/"+getReadFramebuffer()+", init "+initialized+", bound "+bound+", size "+width+"x"+height+
", samples "+samples+"/"+maxSamples+", depth "+depth+", stencil "+stencil+
", color attachments: "+colorAttachmentCount+"/"+maxColorAttachments+
": "+caps+", msaa-sink "+samplingSinkTexture+", hasSamplesSink "+(null != samplingSink)+
", state "+getStatusString()+", obj "+toHexString(objectHashCode())+"]";
}
-
+
private final void updateStatus(GL gl) {
if( 0 == fbName ) {
vStatus = -1;
} else {
vStatus = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
}
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java b/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
index bec05a0bd..ce58d29c1 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.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 com.jogamp.opengl;
import javax.media.nativewindow.AbstractGraphicsDevice;
@@ -58,14 +58,14 @@ import jogamp.opengl.GLDrawableImpl;
*
* and setup a {@link com.jogamp.newt.Window#setWindowDestroyNotifyAction(Runnable) custom toolkit destruction} issuing {@link #windowDestroyNotifyOp()}.
*
- *
+ *
* See example {@link com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateNEWT TestGLAutoDrawableDelegateNEWT}.
*
*/
public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAutoDrawable {
/**
* @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
@@ -84,7 +84,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
this.upstreamWidget = upstreamWidget;
this.lock = ( null != lock ) ? lock : LockFactory.createRecursiveLock() ;
}
-
+
//
// expose default methods
//
@@ -93,40 +93,40 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
public final void windowRepaintOp() {
super.defaultWindowRepaintOp();
}
-
+
/** Implementation to handle resize events from the windowing system. All required locks are being claimed. */
public final void windowResizedOp(int newWidth, int newHeight) {
super.defaultWindowResizedOp(newWidth, newHeight);
}
-
- /**
+
+ /**
* Implementation to handle destroy notifications from the windowing system.
- *
+ *
*
- * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol}
+ * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol}
* or {@link WindowClosingMode#DISPOSE_ON_CLOSE} is enabled (default),
* a thread safe destruction is being induced.
- *
+ *
*/
public final void windowDestroyNotifyOp() {
super.defaultWindowDestroyNotifyOp();
}
-
+
//
// Complete GLAutoDrawable
//
-
+
private Object upstreamWidget;
private final RecursiveLock lock;
-
+
@Override
protected final RecursiveLock getLock() { return lock; }
-
+
@Override
public final Object getUpstreamWidget() {
return upstreamWidget;
}
-
+
/**
* Set the upstream UI toolkit object.
* @see #getUpstreamWidget()
@@ -134,7 +134,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
public final void setUpstreamWidget(Object newUpstreamWidget) {
upstreamWidget = newUpstreamWidget;
}
-
+
/**
* {@inheritDoc}
*
@@ -142,7 +142,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
*
*
* User still needs to destroy the upstream window, which details are hidden from this aspect.
- * This can be performed by overriding {@link #destroyImplInLock()}.
+ * This can be performed by overriding {@link #destroyImplInLock()}.
*
*/
@Override
@@ -154,29 +154,29 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
protected void destroyImplInLock() {
super.destroyImplInLock();
}
-
+
@Override
- public void display() {
+ public void display() {
defaultDisplay();
}
-
+
//
// GLDrawable delegation
//
-
+
@Override
public final GLDrawableFactory getFactory() {
return drawable.getFactory();
}
-
+
@Override
public final void swapBuffers() throws GLException {
defaultSwapBuffers();
}
-
+
@Override
public String toString() {
return getClass().getSimpleName()+"[ \n\tHelper: " + helper + ", \n\tDrawable: " + drawable +
", \n\tContext: " + context + ", \n\tUpstreamWidget: "+upstreamWidget+ /** ", \n\tFactory: "+factory+ */ "]";
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java b/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
index 21dafecb1..1b4187668 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.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.
@@ -48,7 +48,7 @@ import jogamp.opengl.Debug;
import com.jogamp.nativewindow.MutableGraphicsConfiguration;
/**
- * GLEventListenerState is holding {@link GLAutoDrawable} components crucial
+ * GLEventListenerState is holding {@link GLAutoDrawable} components crucial
* to relocating all its {@link GLEventListener} w/ their operating {@link GLContext}, etc.
* The components are:
*
@@ -69,8 +69,8 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
*/
public class GLEventListenerState {
private static final boolean DEBUG = Debug.debug("GLDrawable") || Debug.debug("GLEventListenerState");
-
- private GLEventListenerState(AbstractGraphicsDevice upstreamDevice, boolean proxyOwnsUpstreamDevice, AbstractGraphicsDevice device,
+
+ private GLEventListenerState(AbstractGraphicsDevice upstreamDevice, boolean proxyOwnsUpstreamDevice, AbstractGraphicsDevice device,
GLCapabilitiesImmutable caps,
GLContext context, int count, GLAnimatorControl anim, boolean animStarted) {
this.upstreamDevice = upstreamDevice;
@@ -82,19 +82,19 @@ public class GLEventListenerState {
this.listenersInit = new boolean[count];
this.anim = anim;
this.animStarted = animStarted;
-
+
this.owner = true;
}
/**
- * Returns true, if this instance is the current owner of the components,
+ * Returns true, if this instance is the current owner of the components,
* otherwise false.
*
* Ownership is lost if {@link #moveTo(GLAutoDrawable)} is being called successfully
- * and all components are transferred to the new {@link GLAutoDrawable}.
+ * and all components are transferred to the new {@link GLAutoDrawable}.
*
*/
public final boolean isOwner() { return owner; }
-
+
public final int listenerCount() { return listeners.length; }
public final AbstractGraphicsDevice upstreamDevice;
@@ -103,10 +103,10 @@ public class GLEventListenerState {
public final GLCapabilitiesImmutable caps;
public final GLContext context;
public final GLEventListener[] listeners;
- public final boolean[] listenersInit;
+ public final boolean[] listenersInit;
public final GLAnimatorControl anim;
public final boolean animStarted;
-
+
private boolean owner;
/**
@@ -127,25 +127,25 @@ public class GLEventListenerState {
private static AbstractGraphicsDevice cloneDevice(AbstractGraphicsDevice aDevice) {
return (AbstractGraphicsDevice) aDevice.clone();
}
-
+
/**
- * Moves all GLEventListenerState components from the given {@link GLAutoDrawable}
+ * Moves all GLEventListenerState components from the given {@link GLAutoDrawable}
* to a newly created instance.
*
* Note that all components are removed from the {@link GLAutoDrawable},
* i.e. the {@link GLContext}, all {@link GLEventListener}.
*
- *
+ *
* If the {@link GLAutoDrawable} was added to a {@link GLAnimatorControl}, it is removed
* and the {@link GLAnimatorControl} added to the GLEventListenerState.
*
*
- * The returned GLEventListenerState instance is the {@link #isOwner() owner of the components}.
+ * The returned GLEventListenerState instance is the {@link #isOwner() owner of the components}.
*
- *
+ *
* @param a {@link GLAutoDrawable} source to move components from
* @return new GLEventListenerState instance {@link #isOwner() owning} moved components.
- *
+ *
* @see #moveTo(GLAutoDrawable)
*/
public static GLEventListenerState moveFrom(GLAutoDrawable a) {
@@ -154,16 +154,16 @@ public class GLEventListenerState {
if( null != aAnim ) {
aAnimStarted = aAnim.isStarted();
aAnim.remove(a); // also handles ECT
- } else {
+ } else {
aAnimStarted = false;
}
-
+
final GLEventListenerState glls;
final NativeSurface aSurface = a.getNativeSurface();
final boolean surfaceLocked = false; // NativeSurface.LOCK_SURFACE_NOT_READY < aSurface.lockSurface();
try {
final int aSz = a.getGLEventListenerCount();
-
+
// Create new AbstractGraphicsScreen w/ cloned AbstractGraphicsDevice for future GLAutoDrawable
// allowing this AbstractGraphicsDevice to loose ownership -> not closing display/device!
final AbstractGraphicsConfiguration aCfg = aSurface.getGraphicsConfiguration();
@@ -171,7 +171,7 @@ public class GLEventListenerState {
final AbstractGraphicsDevice aDevice1 = aCfg.getScreen().getDevice();
final AbstractGraphicsDevice aDevice2 = cloneDevice(aDevice1);
aDevice1.clearHandleOwner(); // don't close device handle
- if( DEBUG ) {
+ if( DEBUG ) {
System.err.println("GLEventListenerState.moveFrom.0a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
System.err.println("GLEventListenerState.moveFrom.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
System.err.println("GLEventListenerState.moveFrom.1: "+aSurface.getClass().getName()/*+", "+aSurface*/);
@@ -203,9 +203,9 @@ public class GLEventListenerState {
}
aUpDevice2 = _aUpDevice2;
}
-
- glls = new GLEventListenerState(aUpDevice2, proxyOwnsUpstreamDevice, aDevice2, caps, a.getContext(), aSz, aAnim, aAnimStarted);
-
+
+ glls = new GLEventListenerState(aUpDevice2, proxyOwnsUpstreamDevice, aDevice2, caps, a.getContext(), aSz, aAnim, aAnimStarted);
+
//
// remove and cache all GLEventListener and their init-state
//
@@ -213,41 +213,41 @@ public class GLEventListenerState {
final GLEventListener l = a.getGLEventListener(0);
glls.listenersInit[i] = a.getGLEventListenerInitState(l);
glls.listeners[i] = a.removeGLEventListener( l );
- }
-
+ }
+
//
// trigger glFinish to sync GL ctx
//
a.invoke(true, glFinish);
-
+
a.setContext( null, false );
-
+
} finally {
if( surfaceLocked ) {
aSurface.unlockSurface();
}
- }
-
+ }
+
return glls;
}
/**
- * Moves all GLEventListenerState components to the given {@link GLAutoDrawable}
+ * Moves all GLEventListenerState components to the given {@link GLAutoDrawable}
* from this instance, while loosing {@link #isOwner() ownership}.
- *
+ *
* If the previous {@link GLAutoDrawable} was removed from a {@link GLAnimatorControl} by previous {@link #moveFrom(GLAutoDrawable)},
* the given {@link GLAutoDrawable} is added to the cached {@link GLAnimatorControl}.
- * This operation is skipped, if the given {@link GLAutoDrawable} is already added to a {@link GLAnimatorControl} instance.
+ * This operation is skipped, if the given {@link GLAutoDrawable} is already added to a {@link GLAnimatorControl} instance.
*
*
- * Note: After this operation, the GLEventListenerState reference should be released.
+ * Note: After this operation, the GLEventListenerState reference should be released.
*
- *
+ *
* @param a {@link GLAutoDrawable} destination to move GLEventListenerState components to
- *
+ *
*
* @throws GLException if this preserved {@link AbstractGraphicsDevice} is incompatible w/ the given destination one.
- *
+ *
* @see #moveFrom(GLAutoDrawable)
* @see #isOwner()
*/
@@ -261,22 +261,22 @@ public class GLEventListenerState {
if( aPaused ) {
aAnim.resume();
}
- } else {
+ } else {
aPaused = false;
}
-
+
final List aGLCmds = new ArrayList();
final int aSz = listenerCount();
-
+
final NativeSurface aSurface = a.getNativeSurface();
final boolean surfaceLocked = false; // NativeSurface.LOCK_SURFACE_NOT_READY < aSurface.lockSurface();
final boolean aRealized;
try {
-
+
final MutableGraphicsConfiguration aCfg = (MutableGraphicsConfiguration) aSurface.getGraphicsConfiguration();
/**
final GLCapabilitiesImmutable aCaps = (GLCapabilitiesImmutable) aCfg.getChosenCapabilities();
- if( caps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) != aCaps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) ||
+ if( caps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) != aCaps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) ||
caps.getVisualID(VisualIDHolder.VIDType.NATIVE) != aCaps.getVisualID(VisualIDHolder.VIDType.NATIVE) ) {
throw new GLException("Incompatible Capabilities - Prev-Holder: "+caps+", New-Holder "+caps);
} */
@@ -285,8 +285,8 @@ public class GLEventListenerState {
if( !aDevice1.getUniqueID().equals( aDevice2.getUniqueID() ) ) {
throw new GLException("Incompatible devices: Preserved <"+aDevice2.getUniqueID()+">, target <"+aDevice1.getUniqueID()+">");
}
-
- // collect optional upstream surface info
+
+ // collect optional upstream surface info
final ProxySurface aProxy;
final NativeSurface aUpSurface;
if(aSurface instanceof ProxySurface) {
@@ -302,8 +302,8 @@ public class GLEventListenerState {
}
if( null==aUpSurface && null != upstreamDevice ) {
throw new GLException("Incompatible Surface config - Has Upstream-Surface: Prev-Holder = true, New-Holder = false");
- }
-
+ }
+
// Destroy and remove currently associated GLContext, if any (will be replaced)
a.setContext( null, true );
aRealized = a.isRealized();
@@ -311,7 +311,7 @@ public class GLEventListenerState {
// Unrealize due to device dependencies of an upstream surface, e.g. EGLUpstreamSurfaceHook
a.getDelegatedDrawable().setRealized(false);
}
-
+
// Set new Screen and close previous one
{
if( DEBUG ) {
@@ -319,13 +319,13 @@ public class GLEventListenerState {
System.err.println("GLEventListenerState.moveTo.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
}
DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aDevice1, aDevice2);
- aDevice2.close();
+ aDevice2.close();
if( DEBUG ) {
System.err.println("GLEventListenerState.moveTo.1a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
System.err.println("GLEventListenerState.moveTo.1b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
}
}
-
+
// If using a ProxySurface w/ an upstream surface, set new Screen and close previous one on it
if( null != aUpSurface ) {
final MutableGraphicsConfiguration aUpCfg = (MutableGraphicsConfiguration) aUpSurface.getGraphicsConfiguration();
@@ -339,9 +339,9 @@ public class GLEventListenerState {
System.err.println("GLEventListenerState.moveTo.2a: up-orig 0x"+Integer.toHexString(aUpDevice1.hashCode())+", "+aUpDevice1);
System.err.println("GLEventListenerState.moveTo.2b: up-pres 0x"+Integer.toHexString(aUpDevice2.hashCode())+", "+aUpDevice2);
System.err.println("GLEventListenerState.moveTo.2c: "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString());
- }
+ }
DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aUpDevice1, aUpDevice2);
- aUpDevice2.close();
+ aUpDevice2.close();
if( proxyOwnsUpstreamDevice ) {
aProxy.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
}
@@ -354,7 +354,7 @@ public class GLEventListenerState {
throw new GLException("Incompatible Surface config - Has Upstream-Surface: Prev-Holder = false, New-Holder = true");
}
}
-
+
if( aRealized && null != aUpSurface ) {
a.getDelegatedDrawable().setRealized(true);
}
@@ -369,7 +369,7 @@ public class GLEventListenerState {
}
}
owner = false;
-
+
//
// Trigger GL-Viewport reset and reshape of all initialized GLEventListeners
//
@@ -389,7 +389,7 @@ public class GLEventListenerState {
a.setGLEventListenerInitState(l, listenersInit[i]);
listeners[i] = null;
}
-
+
if( hasAnimator ) {
// prefer already bound animator
aAnim.add(a);
@@ -410,7 +410,7 @@ public class GLEventListenerState {
public boolean run(GLAutoDrawable drawable) {
drawable.getGL().glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
return true;
- }
+ }
};
public static GLRunnable glFinish = new GLRunnable() {
@@ -418,7 +418,7 @@ public class GLEventListenerState {
public boolean run(GLAutoDrawable drawable) {
drawable.getGL().glFinish();
return true;
- }
+ }
};
public static class ReshapeGLEventListener implements GLRunnable {
@@ -430,6 +430,6 @@ public class GLEventListenerState {
public boolean run(GLAutoDrawable drawable) {
listener.reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
return true;
- }
+ }
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
index 14f4be96a..c7aadcd14 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
@@ -28,17 +28,17 @@
package com.jogamp.opengl;
/**
- * Class holding OpenGL extension strings, commonly used by JOGL's implementation.
+ * Class holding OpenGL extension strings, commonly used by JOGL's implementation.
*/
public class GLExtensions {
public static final String VERSION_1_2 = "GL_VERSION_1_2";
public static final String VERSION_1_4 = "GL_VERSION_1_4";
public static final String VERSION_1_5 = "GL_VERSION_1_5";
public static final String VERSION_2_0 = "GL_VERSION_2_0";
-
+
public static final String ARB_debug_output = "GL_ARB_debug_output";
public static final String AMD_debug_output = "GL_AMD_debug_output";
-
+
public static final String ARB_framebuffer_object = "GL_ARB_framebuffer_object";
public static final String OES_framebuffer_object = "GL_OES_framebuffer_object";
public static final String EXT_framebuffer_object = "GL_EXT_framebuffer_object";
@@ -49,17 +49,17 @@ public class GLExtensions {
public static final String OES_depth32 = "GL_OES_depth32";
public static final String OES_packed_depth_stencil = "GL_OES_packed_depth_stencil";
public static final String NV_fbo_color_attachments = "GL_NV_fbo_color_attachments";
-
+
public static final String ARB_ES2_compatibility = "GL_ARB_ES2_compatibility";
public static final String ARB_ES3_compatibility = "GL_ARB_ES3_compatibility";
-
+
public static final String EXT_abgr = "GL_EXT_abgr";
public static final String OES_rgb8_rgba8 = "GL_OES_rgb8_rgba8";
public static final String OES_stencil1 = "GL_OES_stencil1";
public static final String OES_stencil4 = "GL_OES_stencil4";
public static final String OES_stencil8 = "GL_OES_stencil8";
public static final String APPLE_float_pixels = "GL_APPLE_float_pixels";
-
+
public static final String ARB_texture_non_power_of_two = "GL_ARB_texture_non_power_of_two";
public static final String ARB_texture_rectangle = "GL_ARB_texture_rectangle";
public static final String EXT_texture_rectangle = "GL_EXT_texture_rectangle";
@@ -72,15 +72,15 @@ public class GLExtensions {
public static final String OES_read_format = "GL_OES_read_format";
public static final String OES_single_precision = "GL_OES_single_precision";
public static final String OES_EGL_image_external = "GL_OES_EGL_image_external";
-
+
public static final String ARB_gpu_shader_fp64 = "GL_ARB_gpu_shader_fp64";
- public static final String ARB_shader_objects = "GL_ARB_shader_objects";
+ public static final String ARB_shader_objects = "GL_ARB_shader_objects";
public static final String ARB_geometry_shader4 = "GL_ARB_geometry_shader4";
-
+
//
// Aliased GLX/WGL/.. extensions
//
-
- public static final String ARB_pixel_format = "GL_ARB_pixel_format";
+
+ public static final String ARB_pixel_format = "GL_ARB_pixel_format";
public static final String ARB_pbuffer = "GL_ARB_pbuffer";
}
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
index 6ef1e0805..ee77f8d2d 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
@@ -29,20 +29,20 @@ package com.jogamp.opengl;
import java.util.List;
-/**
- * GLRendererQuirks contains information of known bugs of various GL renderer.
+/**
+ * GLRendererQuirks contains information of known bugs of various GL renderer.
* This information allows us to workaround them.
*
* Using centralized quirk identifier enables us to
- * locate code dealing w/ it and hence eases it's maintenance.
+ * locate code dealing w/ it and hence eases it's maintenance.
*
*
* SomeGL_VENDOR and GL_RENDERER strings are
- * listed here .
+ * listed here .
*
*/
public class GLRendererQuirks {
- /**
+ /**
* Crashes XServer when using double buffered PBuffer with GL_RENDERER:
*
*
Mesa DRI Intel(R) Sandybridge Desktop
@@ -52,23 +52,23 @@ public class GLRendererQuirks {
* For now, it is safe to disable it w/ hw-acceleration.
*/
public static final int NoDoubleBufferedPBuffer = 0;
-
+
/** On Windows no double buffered bitmaps are guaranteed to be available. */
public static final int NoDoubleBufferedBitmap = 1;
/** Crashes application when trying to set EGL swap interval on Android 4.0.3 / Pandaboard ES / PowerVR SGX 540 */
public static final int NoSetSwapInterval = 2;
-
+
/** No offscreen bitmap available, currently true for JOGL's OSX implementation. */
public static final int NoOffscreenBitmap = 3;
-
+
/** SIGSEGV on setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel) */
public static final int NoSetSwapIntervalPostRetarget = 4;
/** GLSL discard command leads to undefined behavior or won't get compiled if being used. Appears to have happened on Nvidia Tegra2, but seems to be fine now. FIXME: Constrain version. */
public static final int GLSLBuggyDiscard = 5;
-
- /**
+
+ /**
* Non compliant GL context due to a buggy implementation not suitable for use.
*
* Currently, Mesa >= 9.1.3 (may extend back as far as 9.0) OpenGL 3.1 compatibility
@@ -82,19 +82,19 @@ public class GLRendererQuirks {
*
*
*
- * It still has to be verified whether the AMD OpenGL 3.1 core driver is compliant enought.
+ * It still has to be verified whether the AMD OpenGL 3.1 core driver is compliant enought.
*/
public static final int GLNonCompliant = 6;
-
+
/**
* The OpenGL Context needs a glFlush() before releasing it, otherwise driver may freeze:
*
*/
public static final int GLFlushBeforeRelease = 7;
-
- /**
+
+ /**
* Closing X11 displays may cause JVM crashes or X11 errors with some buggy drivers
* while being used in concert w/ OpenGL.
*
@@ -123,14 +123,14 @@ public class GLRendererQuirks {
*
*/
public static final int DontCloseX11Display = 8;
-
+
/**
- * Need current GL Context when calling new ARB pixel format query functions,
+ * Need current GL Context when calling new ARB pixel format query functions,
* otherwise driver crashes the VM.
*
* Drivers known exposing such bug:
*
- *
ATI proprietary Catalyst driver on Windows version ≤ XP.
+ *
ATI proprietary Catalyst driver on Windows version ≤ XP.
* TODO: Validate if bug actually relates to 'old' ATI Windows drivers for old GPU's like X300
* regardless of the Windows version.
*
@@ -139,7 +139,7 @@ public class GLRendererQuirks {
*
*/
public static final int NeedCurrCtx4ARBPixFmtQueries = 9;
-
+
/**
* Need current GL Context when calling new ARB CreateContext function,
* otherwise driver crashes the VM.
@@ -159,14 +159,14 @@ public class GLRendererQuirks {
*
*/
public static final int NeedCurrCtx4ARBCreateContext = 10;
-
+
/**
* No full FBO support, i.e. not compliant w/
- *
+ *
*
GL_ARB_framebuffer_object
- *
EXT_framebuffer_object
- *
EXT_framebuffer_multisample
- *
EXT_framebuffer_blit
+ *
EXT_framebuffer_object
+ *
EXT_framebuffer_multisample
+ *
EXT_framebuffer_blit
*
EXT_packed_depth_stencil
*
.
* Drivers known exposing such bug:
@@ -180,18 +180,18 @@ public class GLRendererQuirks {
* Quirk can also be enabled via property: jogl.fbo.force.min.
*/
public static final int NoFullFBOSupport = 11;
-
+
/**
* GLSL is not compliant or even not stable (crash)
*
*/
public static final int GLSLNonCompliant = 12;
-
+
/** Number of quirks known. */
public static final int COUNT = 13;
-
+
private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval",
"NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "GLSLBuggyDiscard",
"GLNonCompliant", "GLFlushBeforeRelease", "DontCloseX11Display",
@@ -218,7 +218,7 @@ public class GLRendererQuirks {
bitmask |= 1 << quirk;
}
_bitmask = bitmask;
- }
+ }
/**
* @param quirks a list of valid quirks
@@ -233,7 +233,7 @@ public class GLRendererQuirks {
}
_bitmask = bitmask;
}
-
+
/**
* @param quirk the quirk to be tested
* @return true if quirk exist, otherwise false
@@ -261,7 +261,7 @@ public class GLRendererQuirks {
sb.append("]");
return sb;
}
-
+
public final String toString() {
return toString(null).toString();
}
@@ -273,7 +273,7 @@ public class GLRendererQuirks {
public static void validateQuirk(int quirk) throws IllegalArgumentException {
if( !( 0 <= quirk && quirk < COUNT ) ) {
throw new IllegalArgumentException("Quirks must be in range [0.."+COUNT+"[, but quirk: "+quirk);
- }
+ }
}
/**
diff --git a/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java b/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java
index 321d4ee57..b98c4431d 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.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.
@@ -31,12 +31,12 @@ package com.jogamp.opengl;
* Interface adding a {@link GLEventListenerState} protocol to {@link GLAutoDrawable}s
* or other self-contained compound types combining {@link GLDrawable}, {@link GLContext} and {@link GLEventListener}.
*
- * Implementing classes {@link #isGLStatePreservationSupported() may support} preservation
- * of the {@link GLContext} state and it's associated {@link GLEventListener}.
- *
+ * Implementing classes {@link #isGLStatePreservationSupported() may support} preservation
+ * of the {@link GLContext} state and it's associated {@link GLEventListener}.
+ *
*/
public interface GLStateKeeper {
-
+
/** Listener for preserve and restore notifications. */
public static interface Listener {
/** Invoked before preservation. */
@@ -44,14 +44,14 @@ public interface GLStateKeeper {
/** Invoked after restoration. */
void glStateRestored(GLStateKeeper glsk);
}
-
- /**
+
+ /**
* Sets a {@link Listener}, overriding the old one.
* @param l the new {@link Listener}.
* @return the previous {@link Listener}.
*/
public Listener setGLStateKeeperListener(Listener l);
-
+
/**
* @return true if GL state preservation is supported in implementation and on current platform, false otherwise.
* @see #preserveGLStateAtDestroy(boolean)
@@ -59,7 +59,7 @@ public interface GLStateKeeper {
* @see #clearPreservedGLState()
*/
public boolean isGLStatePreservationSupported();
-
+
/**
* If set to true, the next {@link GLAutoDrawable#destroy()} operation will
* {@link #pullGLEventListenerState() pull} to preserve the {@link GLEventListenerState}.
@@ -68,8 +68,8 @@ public interface GLStateKeeper {
* the flag is cleared.
*
*
- * A preserved {@link GLEventListenerState} will be {@link #pushGLEventListenerState() pushed}
- * if realized again.
+ * A preserved {@link GLEventListenerState} will be {@link #pushGLEventListenerState() pushed}
+ * if realized again.
*
* @return true if supported and successful, false otherwise.
* @see #isGLStatePreservationSupported()
@@ -77,21 +77,21 @@ public interface GLStateKeeper {
* @see #clearPreservedGLState()
*/
public boolean preserveGLStateAtDestroy(boolean value);
-
+
/**
* Returns the preserved {@link GLEventListenerState} if preservation was performed,
- * otherwise null.
+ * otherwise null.
* @see #isGLStatePreservationSupported()
* @see #preserveGLStateAtDestroy(boolean)
* @see #clearPreservedGLState()
*/
public GLEventListenerState getPreservedGLState();
-
+
/**
* Clears the preserved {@link GLEventListenerState} from this {@link GLStateKeeper}, without destroying it.
- *
+ *
* @return the preserved and cleared {@link GLEventListenerState} if preservation was performed,
- * otherwise null.
+ * otherwise null.
* @see #isGLStatePreservationSupported()
* @see #preserveGLStateAtDestroy(boolean)
* @see #getPreservedGLState()
diff --git a/src/jogl/classes/com/jogamp/opengl/GenericGLCapabilitiesChooser.java b/src/jogl/classes/com/jogamp/opengl/GenericGLCapabilitiesChooser.java
index 73ec10886..3693f647a 100644
--- a/src/jogl/classes/com/jogamp/opengl/GenericGLCapabilitiesChooser.java
+++ b/src/jogl/classes/com/jogamp/opengl/GenericGLCapabilitiesChooser.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.
@@ -37,7 +37,7 @@ import javax.media.opengl.DefaultGLCapabilitiesChooser;
* otherwise uses {@link DefaultGLCapabilitiesChooser} implementation.
*/
public class GenericGLCapabilitiesChooser extends DefaultGLCapabilitiesChooser {
-
+
@Override
public int chooseCapabilities(final CapabilitiesImmutable desired,
final List extends CapabilitiesImmutable> available,
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index 1f0189aa3..1f715c21a 100644
--- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.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 com.jogamp.opengl;
import com.jogamp.common.GlueGenVersion;
@@ -90,16 +90,16 @@ public class JoglVersion extends JogampVersion {
sb.append("\tnone").append(Platform.getNewline());
}
sb.append(Platform.getNewline());
- return sb;
+ return sb;
}
-
+
public static StringBuilder getAllAvailableCapabilitiesInfo(AbstractGraphicsDevice device, StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
}
if(null == device) {
device = GLProfile.getDefaultDevice();
- }
+ }
sb.append(Platform.getNewline()).append(Platform.getNewline());
sb.append("Desktop Capabilities: ").append(Platform.getNewline());
getAvailableCapabilitiesInfo(GLDrawableFactory.getDesktopFactory(), device, sb);
@@ -107,7 +107,7 @@ public class JoglVersion extends JogampVersion {
getAvailableCapabilitiesInfo(GLDrawableFactory.getEGLFactory(), device, sb);
return sb;
}
-
+
public static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, boolean withCapabilitiesInfo) {
if(null==sb) {
sb = new StringBuilder();
@@ -126,7 +126,7 @@ public class JoglVersion extends JogampVersion {
}
return sb;
}
-
+
public static StringBuilder getGLInfo(GL gl, StringBuilder sb) {
return getGLInfo(gl, sb, false);
}
@@ -136,26 +136,26 @@ public class JoglVersion extends JogampVersion {
if(null==sb) {
sb = new StringBuilder();
}
-
+
sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline());
sb.append(device.getClass().getSimpleName()).append("[type ")
.append(device.getType()).append(", connection ").append(device.getConnection()).append("]: ").append(Platform.getNewline());
- GLProfile.glAvailabilityToString(device, sb, "\t", 1);
+ GLProfile.glAvailabilityToString(device, sb, "\t", 1);
sb.append(Platform.getNewline());
sb = getGLStrings(gl, sb, withCapabilitiesAndExtensionInfo);
-
+
if( withCapabilitiesAndExtensionInfo ) {
- sb = getAllAvailableCapabilitiesInfo(device, sb);
+ sb = getAllAvailableCapabilitiesInfo(device, sb);
}
return sb;
}
-
+
public static StringBuilder getGLStrings(GL gl, StringBuilder sb) {
return getGLStrings(gl, sb, true);
}
-
- public static StringBuilder getGLStrings(GL gl, StringBuilder sb, boolean withExtensions) {
+
+ public static StringBuilder getGLStrings(GL gl, StringBuilder sb, boolean withExtensions) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -175,7 +175,7 @@ public class JoglVersion extends JogampVersion {
sb.append("GL_RENDERER ").append(gl.glGetString(GL.GL_RENDERER));
sb.append(Platform.getNewline());
sb.append("GL_VERSION ").append(gl.glGetString(GL.GL_VERSION));
- sb.append(Platform.getNewline());
+ sb.append(Platform.getNewline());
sb.append("GLSL ").append(gl.hasGLSL()).append(", has-compiler-func: ").append(gl.isFunctionAvailable("glCompileShader"));
if(gl.hasGLSL()) {
sb.append(", version: ").append(gl.glGetString(GL2ES2.GL_SHADING_LANGUAGE_VERSION)).append(" / ").append(ctx.getGLSLVersionNumber());
@@ -200,7 +200,7 @@ public class JoglVersion extends JogampVersion {
return sb;
}
- public StringBuilder getBriefOSGLBuildInfo(GL gl, StringBuilder sb) {
+ public StringBuilder getBriefOSGLBuildInfo(GL gl, StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -216,7 +216,7 @@ public class JoglVersion extends JogampVersion {
sb.append(Platform.getNewline());
return sb;
}
-
+
public static void main(String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
index ca4846939..8d2d07d58 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.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 com.jogamp.opengl.cg;
import com.jogamp.common.jvm.JNILibLoaderBase;
@@ -45,15 +45,15 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
Platform.initSingleton();
-
+
if(TempJarCache.isInitialized()) {
// only: jogl-cg.jar -> jogl-cg-natives-.jar [atomic JAR files only]
- JNILibLoaderBase.addNativeJarLibs(new Class>[] { CgDynamicLibraryBundleInfo.class }, null, null );
+ JNILibLoaderBase.addNativeJarLibs(new Class>[] { CgDynamicLibraryBundleInfo.class }, null, null );
}
return null;
}
});
-
+
glueLibNames = new ArrayList();
// glueLibNames.addAll(getGlueLibNamesPreload());
glueLibNames.add("jogl_cg");
@@ -76,7 +76,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
*
* Returns false.
*
- */
+ */
@Override
public final boolean shallLookupGlobal() { return false; }
@@ -91,7 +91,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
return 0;
}
-
+
@Override
public final boolean useToolGetProcAdressFirst(String funcName) {
return false;
@@ -103,7 +103,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
final List libsCg = new ArrayList();
libsCg.add("Cg");
libsList.add(libsCg);
-
+
final List libsCgGL = new ArrayList();
libsCgGL.add("CgGL");
libsList.add(libsCgGL);
@@ -119,7 +119,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
@Override
public final RunnableExecutor getLibLoaderExecutor() {
return DynamicLibraryBundle.getDefaultRunnableExecutor();
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgException.java b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
index 8bfd9e23e..3e42f4d70 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java b/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
index e0acfec28..b7dbf183f 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2009 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,7 +28,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 com.jogamp.opengl.math;
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
index f3f44f15a..191a83241 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
@@ -40,7 +40,7 @@ import com.jogamp.common.os.Platform;
*
* Derived from ProjectFloat.java - Created 11-jan-2004
*
- *
+ *
* @author Erik Duijs
* @author Kenneth Russell
* @author Sven Gothel
@@ -95,7 +95,7 @@ public class FloatUtil {
m.put(ZERO_MATRIX);
m.position(oldPos);
}
-
+
/**
* @param a 4x4 matrix in column-major order
* @param b 4x4 matrix in column-major order
@@ -111,7 +111,7 @@ public class FloatUtil {
d[d_off+i+3*4] = ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] ;
}
}
-
+
/**
* @param a 4x4 matrix in column-major order (also result)
* @param b 4x4 matrix in column-major order
@@ -127,7 +127,7 @@ public class FloatUtil {
a[a_off_i+3*4] = ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] ;
}
}
-
+
/**
* @param a 4x4 matrix in column-major order
* @param b 4x4 matrix in column-major order
@@ -151,7 +151,7 @@ public class FloatUtil {
* @param d result a*b in column-major order
*/
public static final void multMatrixf(final FloatBuffer a, final float[] b, int b_off, FloatBuffer d) {
- final int aP = a.position();
+ final int aP = a.position();
final int dP = d.position();
for (int i = 0; i < 4; i++) {
// one row in column-major order
@@ -162,13 +162,13 @@ public class FloatUtil {
d.put(dP+i+3*4 , ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] );
}
}
-
+
/**
* @param a 4x4 matrix in column-major order (also result)
* @param b 4x4 matrix in column-major order
*/
public static final void multMatrixf(final FloatBuffer a, final float[] b, int b_off) {
- final int aP = a.position();
+ final int aP = a.position();
for (int i = 0; i < 4; i++) {
// one row in column-major order
final int aP_i = aP+i;
@@ -186,7 +186,7 @@ public class FloatUtil {
* @param d result a*b in column-major order
*/
public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b, FloatBuffer d) {
- final int aP = a.position();
+ final int aP = a.position();
final int bP = b.position();
final int dP = d.position();
for (int i = 0; i < 4; i++) {
@@ -198,13 +198,13 @@ public class FloatUtil {
d.put(dP+i+3*4 , ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) );
}
}
-
+
/**
* @param a 4x4 matrix in column-major order (also result)
* @param b 4x4 matrix in column-major order
*/
public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b) {
- final int aP = a.position();
+ final int aP = a.position();
final int bP = b.position();
for (int i = 0; i < 4; i++) {
// one row in column-major order
@@ -216,14 +216,14 @@ public class FloatUtil {
a.put(aP_i+3*4 , ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) );
}
}
-
+
/**
* @param a 4x4 matrix in column-major order
* @param b 4x4 matrix in column-major order
* @param d result a*b in column-major order
*/
public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b, float[] d, int d_off) {
- final int aP = a.position();
+ final int aP = a.position();
final int bP = b.position();
for (int i = 0; i < 4; i++) {
// one row in column-major order
@@ -234,7 +234,7 @@ public class FloatUtil {
d[d_off+i+3*4] = ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) ;
}
}
-
+
/**
* Normalize vector
*
@@ -242,7 +242,7 @@ public class FloatUtil {
*/
public static final void normalize(float[] v) {
float r = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-
+
if ( r == 0.0 || r == 1.0) {
return;
}
@@ -265,7 +265,7 @@ public class FloatUtil {
float r = (float) Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
v.get(1+vPos) * v.get(1+vPos) +
v.get(2+vPos) * v.get(2+vPos));
-
+
if ( r == 0.0 || r == 1.0) {
return;
}
@@ -341,7 +341,7 @@ public class FloatUtil {
v_in[3] * m_in[3*4+i];
}
}
-
+
/**
* @param m_in 4x4 matrix in column-major order
* @param v_in 4-component column-vector
@@ -355,10 +355,10 @@ public class FloatUtil {
v_in[0+v_in_off] * m_in.get(0*4+i+matrixPos) +
v_in[1+v_in_off] * m_in.get(1*4+i+matrixPos) +
v_in[2+v_in_off] * m_in.get(2*4+i+matrixPos) +
- v_in[3+v_in_off] * m_in.get(3*4+i+matrixPos);
+ v_in[3+v_in_off] * m_in.get(3*4+i+matrixPos);
}
}
-
+
/**
* @param m_in 4x4 matrix in column-major order
* @param v_in 4-component column-vector
@@ -372,10 +372,10 @@ public class FloatUtil {
v_in[0] * m_in.get(0*4+i+matrixPos) +
v_in[1] * m_in.get(1*4+i+matrixPos) +
v_in[2] * m_in.get(2*4+i+matrixPos) +
- v_in[3] * m_in.get(3*4+i+matrixPos);
+ v_in[3] * m_in.get(3*4+i+matrixPos);
}
}
-
+
/**
* @param m_in 4x4 matrix in column-major order
* @param v_in 4-component column-vector
@@ -395,7 +395,7 @@ public class FloatUtil {
}
}
- /**
+ /**
* @param sb optional passed StringBuilder instance to be used
* @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
* @param a mxn matrix (rows x columns)
@@ -403,7 +403,7 @@ public class FloatUtil {
* @param rows
* @param columns
* @param rowMajorOrder if true floats are layed out in row-major-order, otherwise column-major-order (OpenGL)
- * @param row row number to print
+ * @param row row number to print
* @return matrix row string representation
*/
public static StringBuilder matrixRowToString(StringBuilder sb, String f, FloatBuffer a, int aOffset, int rows, int columns, boolean rowMajorOrder, int row) {
@@ -413,17 +413,17 @@ public class FloatUtil {
final int a0 = aOffset + a.position();
if(rowMajorOrder) {
for(int c=0; ca's current position
@@ -469,14 +469,14 @@ public class FloatUtil {
for(int i=0; ia's current position
@@ -493,14 +493,14 @@ public class FloatUtil {
for(int i=0; ia's current position
@@ -521,14 +521,14 @@ public class FloatUtil {
matrixRowToString(sb, f, a, aOffset, rows, columns, rowMajorOrder, i);
sb.append("=?= ");
matrixRowToString(sb, f, b, bOffset, rows, columns, rowMajorOrder, i);
- sb.append("]").append(Platform.getNewline());
+ sb.append("]").append(Platform.getNewline());
}
return sb;
}
- /**
+ /**
* @param sb optional passed StringBuilder instance to be used
- * @param rowPrefix optional prefix for each row
+ * @param rowPrefix optional prefix for each row
* @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
* @param a 4x4 matrix in column major order (OpenGL)
* @param aOffset offset to a's current position
@@ -549,11 +549,11 @@ public class FloatUtil {
matrixRowToString(sb, f, a, aOffset, rows, columns, rowMajorOrder, i);
sb.append("=?= ");
matrixRowToString(sb, f, b, bOffset, rows, columns, rowMajorOrder, i);
- sb.append("]").append(Platform.getNewline());
+ sb.append("]").append(Platform.getNewline());
}
return sb;
}
-
+
public static final float E = 2.7182818284590452354f;
public static final float PI = 3.14159265358979323846f;
@@ -569,5 +569,5 @@ public class FloatUtil {
public static float acos(float a) { return (float) java.lang.Math.acos(a); }
public static float sqrt(float a) { return (float) java.lang.Math.sqrt(a); }
-
+
}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
index c6bf44f6d..78cbb18cf 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
@@ -33,7 +33,7 @@ public class Quaternion {
public Quaternion() {
setIdentity();
}
-
+
public Quaternion(Quaternion q) {
x = q.x;
y = q.y;
@@ -50,7 +50,7 @@ public class Quaternion {
/**
* Constructor to create a rotation based quaternion from two vectors
- *
+ *
* @param vector1
* @param vector2
*/
@@ -59,7 +59,7 @@ public class Quaternion {
final float[] cross = VectorUtil.cross(vector1, vector2);
fromAxis(cross, theta);
}
-
+
/***
* Constructor to create a rotation based quaternion from axis vector and angle
* @param vector axis vector
@@ -69,10 +69,10 @@ public class Quaternion {
public Quaternion(float[] vector, float angle) {
fromAxis(vector, angle);
}
-
+
/***
* Initialize this quaternion with given axis vector and rotation angle
- *
+ *
* @param vector axis vector
* @param angle rotation angle (rads)
*/
@@ -88,7 +88,7 @@ public class Quaternion {
/**
* Transform the rotational quaternion to axis based rotation angles
- *
+ *
* @return new float[4] with ,theta,Rx,Ry,Rz
*/
public float[] toAxis() {
@@ -135,7 +135,7 @@ public class Quaternion {
/**
* Add a quaternion
- *
+ *
* @param q quaternion
*/
public void add(Quaternion q) {
@@ -146,7 +146,7 @@ public class Quaternion {
/**
* Subtract a quaternion
- *
+ *
* @param q quaternion
*/
public void subtract(Quaternion q) {
@@ -157,7 +157,7 @@ public class Quaternion {
/**
* Divide a quaternion by a constant
- *
+ *
* @param n a float to divide by
*/
public void divide(float n) {
@@ -168,7 +168,7 @@ public class Quaternion {
/**
* Multiply this quaternion by the param quaternion
- *
+ *
* @param q a quaternion to multiply with
*/
public void mult(Quaternion q) {
@@ -186,7 +186,7 @@ public class Quaternion {
/**
* Multiply a quaternion by a constant
- *
+ *
* @param n a float constant
*/
public void mult(float n) {
@@ -194,10 +194,10 @@ public class Quaternion {
y *= n;
z *= n;
}
-
+
/***
* Rotate given vector by this quaternion
- *
+ *
* @param vector input vector
* @return rotated vector
*/
@@ -250,7 +250,7 @@ public class Quaternion {
/**
* Transform this quaternion to a 4x4 column matrix representing the
* rotation
- *
+ *
* @return new float[16] column matrix 4x4
*/
public float[] toMatrix() {
@@ -287,7 +287,7 @@ public class Quaternion {
* See http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/
* quaternions/slerp/
*
- *
+ *
* @param a initial quaternion
* @param b target quaternion
* @param t float between 0 and 1 representing interp.
@@ -332,13 +332,13 @@ public class Quaternion {
/**
* Check if this quaternion represents an identity matrix for rotation,
* , ie (0,0,0,1).
- *
+ *
* @return true if it is an identity rep., false otherwise
*/
public boolean isIdentity() {
return w == 1 && x == 0 && y == 0 && z == 0;
}
-
+
/***
* Set this quaternion to identity (x=0,y=0,z=0,w=1)
*/
@@ -349,7 +349,7 @@ public class Quaternion {
/**
* compute the quaternion from a 3x3 column matrix
- *
+ *
* @param m 3x3 column matrix
*/
public void setFromMatrix(float[] m) {
@@ -386,7 +386,7 @@ public class Quaternion {
/**
* Check if the the 3x3 matrix (param) is in fact an affine rotational
* matrix
- *
+ *
* @param m 3x3 column matrix
* @return true if representing a rotational matrix, false otherwise
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java b/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
index 0033afeaa..508f1aafd 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
@@ -39,7 +39,7 @@ public class VectorUtil {
Winding(int dir) {
this.dir = dir;
}
- }
+ }
public static final int COLLINEAR = 0;
@@ -119,15 +119,15 @@ public class VectorUtil {
/** Column Matrix Vector multiplication
* @param colMatrix column matrix (4x4)
* @param vec vector(x,y,z)
- * @return result new float[3]
+ * @return result new float[3]
*/
public static float[] colMatrixVectorMult(float[] colMatrix, float[] vec)
{
final float[] out = new float[3];
- out[0] = vec[0]*colMatrix[0] + vec[1]*colMatrix[4] + vec[2]*colMatrix[8] + colMatrix[12];
- out[1] = vec[0]*colMatrix[1] + vec[1]*colMatrix[5] + vec[2]*colMatrix[9] + colMatrix[13];
- out[2] = vec[0]*colMatrix[2] + vec[1]*colMatrix[6] + vec[2]*colMatrix[10] + colMatrix[14];
+ out[0] = vec[0]*colMatrix[0] + vec[1]*colMatrix[4] + vec[2]*colMatrix[8] + colMatrix[12];
+ out[1] = vec[0]*colMatrix[1] + vec[1]*colMatrix[5] + vec[2]*colMatrix[9] + colMatrix[13];
+ out[2] = vec[0]*colMatrix[2] + vec[1]*colMatrix[6] + vec[2]*colMatrix[10] + colMatrix[14];
return out;
}
@@ -135,15 +135,15 @@ public class VectorUtil {
/** Matrix Vector multiplication
* @param rawMatrix column matrix (4x4)
* @param vec vector(x,y,z)
- * @return result new float[3]
+ * @return result new float[3]
*/
public static float[] rowMatrixVectorMult(float[] rawMatrix, float[] vec)
{
final float[] out = new float[3];
- out[0] = vec[0]*rawMatrix[0] + vec[1]*rawMatrix[1] + vec[2]*rawMatrix[2] + rawMatrix[3];
- out[1] = vec[0]*rawMatrix[4] + vec[1]*rawMatrix[5] + vec[2]*rawMatrix[6] + rawMatrix[7];
- out[2] = vec[0]*rawMatrix[8] + vec[1]*rawMatrix[9] + vec[2]*rawMatrix[10] + rawMatrix[11];
+ out[0] = vec[0]*rawMatrix[0] + vec[1]*rawMatrix[1] + vec[2]*rawMatrix[2] + rawMatrix[3];
+ out[1] = vec[0]*rawMatrix[4] + vec[1]*rawMatrix[5] + vec[2]*rawMatrix[6] + rawMatrix[7];
+ out[2] = vec[0]*rawMatrix[8] + vec[1]*rawMatrix[9] + vec[2]*rawMatrix[10] + rawMatrix[11];
return out;
}
@@ -157,7 +157,7 @@ public class VectorUtil {
{
return (p1+p2)/2.0f;
}
-
+
/** Calculate the midpoint of two points
* @param p1 first point
* @param p2 second point
@@ -172,7 +172,7 @@ public class VectorUtil {
return midPoint;
}
-
+
/** Compute the norm of a vector
* @param vec vector
* @return vorm
@@ -181,7 +181,7 @@ public class VectorUtil {
{
return FloatUtil.sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]);
}
-
+
/** Compute distance between 2 points
* @param p0 a ref point on the line
* @param vec vector representing the direction of the line
@@ -216,7 +216,7 @@ public class VectorUtil {
*/
public static boolean checkEqualityVec2(float[] v1, float[] v2)
{
- return Float.compare(v1[0], v2[0]) == 0 &&
+ return Float.compare(v1[0], v2[0]) == 0 &&
Float.compare(v1[1], v2[1]) == 0 ;
}
@@ -261,7 +261,7 @@ public class VectorUtil {
* @param b triangle vertex 2
* @param c triangle vertex 3
* @param d vertex in question
- * @return true if the vertex d is inside the circle defined by the
+ * @return true if the vertex d is inside the circle defined by the
* vertices a, b, c. from paper by Guibas and Stolfi (1985).
*/
public static boolean inCircle(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d){
@@ -282,8 +282,8 @@ public class VectorUtil {
return (b.getX() - a.getX()) * (c.getY() - a.getY()) - (b.getY() - a.getY())*(c.getX() - a.getX());
}
- /** Check if a vertex is in triangle using
- * barycentric coordinates computation.
+ /** Check if a vertex is in triangle using
+ * barycentric coordinates computation.
* @param a first triangle vertex
* @param b second triangle vertex
* @param c third triangle vertex
@@ -291,7 +291,7 @@ public class VectorUtil {
* @return true if p is in triangle (a, b, c), false otherwise.
*/
public static boolean vertexInTriangle(float[] a, float[] b, float[] c, float[] p){
- // Compute vectors
+ // Compute vectors
final float[] ac = computeVector(a, c); //v0
final float[] ab = computeVector(a, b); //v1
final float[] ap = computeVector(a, p); //v2
@@ -362,13 +362,13 @@ public class VectorUtil {
* @param b vertex 2 of first segment
* @param c vertex 1 of second segment
* @param d vertex 2 of second segment
- * @return the intersection coordinates if the segments intersect, otherwise
- * returns null
+ * @return the intersection coordinates if the segments intersect, otherwise
+ * returns null
*/
public static float[] seg2SegIntersection(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d) {
final float determinant = (a.getX()-b.getX())*(c.getY()-d.getY()) - (a.getY()-b.getY())*(c.getX()-d.getX());
- if (determinant == 0)
+ if (determinant == 0)
return null;
final float alpha = (a.getX()*b.getY()-a.getY()*b.getX());
@@ -389,13 +389,13 @@ public class VectorUtil {
* @param b vertex 2 of first line
* @param c vertex 1 of second line
* @param d vertex 2 of second line
- * @return the intersection coordinates if the lines intersect, otherwise
- * returns null
+ * @return the intersection coordinates if the lines intersect, otherwise
+ * returns null
*/
public static float[] line2lineIntersection(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d) {
final float determinant = (a.getX()-b.getX())*(c.getY()-d.getY()) - (a.getY()-b.getY())*(c.getX()-d.getX());
- if (determinant == 0)
+ if (determinant == 0)
return null;
final float alpha = (a.getX()*b.getY()-a.getY()*b.getX());
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Vert2fImmutable.java b/src/jogl/classes/com/jogamp/opengl/math/Vert2fImmutable.java
index 13349884c..ec90b401f 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Vert2fImmutable.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Vert2fImmutable.java
@@ -33,7 +33,7 @@ public interface Vert2fImmutable {
float getY();
int getCoordCount();
-
+
float[] getCoord();
-
+
}
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
index b6e8ede2e..f1880a61b 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
@@ -32,23 +32,23 @@ import com.jogamp.opengl.math.VectorUtil;
/**
* Axis Aligned Bounding Box. Defined by two 3D coordinates (low and high)
- * The low being the the lower left corner of the box, and the high being the upper
+ * The low being the the lower left corner of the box, and the high being the upper
* right corner of the box.
- *
+ *
*/
public class AABBox implements Cloneable {
private float[] low = new float[3];
private float[] high = new float[3];
private float[] center = new float[3];
- /** Create a Axis Aligned bounding box (AABBox)
+ /** Create a Axis Aligned bounding box (AABBox)
* where the low and and high MAX float Values.
*/
public AABBox() {
reset();
}
- /** Create an AABBox specifying the coordinates
+ /** Create an AABBox specifying the coordinates
* of the low and high
* @param lx min x-coordinate
* @param ly min y-coordnate
@@ -61,7 +61,7 @@ public class AABBox implements Cloneable {
float hx, float hy, float hz) {
setSize(lx, ly, lz, hx, hy, hz);
}
-
+
/** Create a AABBox defining the low and high
* @param low min xyz-coordinates
* @param high max xyz-coordinates
@@ -78,27 +78,27 @@ public class AABBox implements Cloneable {
center[1] = 0f;
center[2] = 0f;
}
-
+
/** Get the max xyz-coordinates
* @return a float array containing the max xyz coordinates
*/
public final float[] getHigh() {
return high;
}
-
+
private final void setHigh(float hx, float hy, float hz) {
this.high[0] = hx;
this.high[1] = hy;
this.high[2] = hz;
}
-
+
/** Get the min xyz-coordinates
* @return a float array containing the min xyz coordinates
*/
public final float[] getLow() {
return low;
}
-
+
private final void setLow(float lx, float ly, float lz) {
this.low[0] = lx;
this.low[1] = ly;
@@ -111,10 +111,10 @@ public class AABBox implements Cloneable {
center[2] = (high[2] + low[2])/2;
}
- /**
- * Set size of the AABBox specifying the coordinates
+ /**
+ * Set size of the AABBox specifying the coordinates
* of the low and high.
- *
+ *
* @param lx min x-coordinate
* @param ly min y-coordnate
* @param lz min z-coordinate
@@ -123,7 +123,7 @@ public class AABBox implements Cloneable {
* @param hz max z-coordinate
*/
public final void setSize(float lx, float ly, float lz,
- float hx, float hy, float hz) {
+ float hx, float hy, float hz) {
this.low[0] = lx;
this.low[1] = ly;
this.low[2] = lz;
@@ -132,7 +132,7 @@ public class AABBox implements Cloneable {
this.high[2] = hz;
computeCenter();
}
-
+
/** Resize the AABBox to encapsulate another AABox
* @param newBox AABBox to be encapsulated in
*/
@@ -160,12 +160,12 @@ public class AABBox implements Cloneable {
}
/** Resize the AABBox to encapsulate the passed
- * xyz-coordinates.
+ * xyz-coordinates.
* @param x x-axis coordinate value
* @param y y-axis coordinate value
* @param z z-axis coordinate value
*/
- public final void resize(float x, float y, float z) {
+ public final void resize(float x, float y, float z) {
/** test low */
if (x < low[0])
low[0] = x;
@@ -181,12 +181,12 @@ public class AABBox implements Cloneable {
high[1] = y;
if (z > high[2])
high[2] = z;
-
+
computeCenter();
}
/** Resize the AABBox to encapsulate the passed
- * xyz-coordinates.
+ * xyz-coordinates.
* @param xyz xyz-axis coordinate values
* @param offset of the array
*/
@@ -210,7 +210,7 @@ public class AABBox implements Cloneable {
}
return true;
}
-
+
/** Check if the xyz coordinates are bounded/contained
* by this AABBox.
* @param x x-axis coordinate value
@@ -231,7 +231,7 @@ public class AABBox implements Cloneable {
}
return true;
}
-
+
/** Check if there is a common region between this AABBox and the passed
* 2D region irrespective of z range
* @param x lower left x-coord
@@ -244,13 +244,13 @@ public class AABBox implements Cloneable {
if (w <= 0 || h <= 0) {
return false;
}
-
+
final float _w = getWidth();
- final float _h = getHeight();
+ final float _h = getHeight();
if (_w <= 0 || _h <= 0) {
return false;
}
-
+
final float x0 = getMinX();
final float y0 = getMinY();
return (x + w > x0 &&
@@ -259,8 +259,8 @@ public class AABBox implements Cloneable {
y < y0 + _h);
}
-
- /** Get the size of the Box where the size is represented by the
+
+ /** Get the size of the Box where the size is represented by the
* length of the vector between low and high.
* @return a float representing the size of the AABBox
*/
@@ -283,16 +283,16 @@ public class AABBox implements Cloneable {
diffH[0] = high[0] - center[0];
diffH[1] = high[1] - center[1];
diffH[2] = high[2] - center[2];
-
+
diffH = VectorUtil.scale(diffH, size);
-
+
float[] diffL = new float[3];
diffL[0] = low[0] - center[0];
diffL[1] = low[1] - center[1];
diffL[2] = low[2] - center[2];
-
+
diffL = VectorUtil.scale(diffL, size);
-
+
high = VectorUtil.vectorAdd(center, diffH);
low = VectorUtil.vectorAdd(center, diffL);
}
@@ -300,43 +300,43 @@ public class AABBox implements Cloneable {
public final float getMinX() {
return low[0];
}
-
+
public final float getMinY() {
return low[1];
}
-
+
public final float getMinZ() {
return low[2];
}
-
+
public final float getMaxX() {
return high[0];
}
-
+
public final float getMaxY() {
return high[1];
}
-
+
public final float getMaxZ() {
return high[2];
}
-
+
public final float getWidth(){
return high[0] - low[0];
}
-
+
public final float getHeight() {
return high[1] - low[1];
}
-
+
public final float getDepth() {
return high[2] - low[2];
}
-
+
public final AABBox clone() {
return new AABBox(this.low, this.high);
}
-
+
public final boolean equals(Object obj) {
if( obj == this ) {
return true;
@@ -344,11 +344,11 @@ public class AABBox implements Cloneable {
if( null == obj || !(obj instanceof AABBox) ) {
return false;
}
- final AABBox other = (AABBox) obj;
- return VectorUtil.checkEquality(low, other.low) &&
+ final AABBox other = (AABBox) obj;
+ return VectorUtil.checkEquality(low, other.low) &&
VectorUtil.checkEquality(high, other.high) ;
}
-
+
public final String toString() {
return "[ "+low[0]+"/"+low[1]+"/"+low[1]+" .. "+high[0]+"/"+high[0]+"/"+high[0]+", ctr "+
center[0]+"/"+center[1]+"/"+center[1]+" ]";
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
index 93e68a1d6..fb311083f 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
@@ -30,11 +30,11 @@ package com.jogamp.opengl.math.geom;
import com.jogamp.common.os.Platform;
/**
- * Providing frustum {@link #getPlanes() planes} derived by different inputs
+ * Providing frustum {@link #getPlanes() planes} derived by different inputs
* ({@link #updateByPMV(float[], int) P*MV}, ..)
- * used to {@link #classifySphere(float[], float) classify objects} and to test
+ * used to {@link #classifySphere(float[], float) classify objects} and to test
* whether they are {@link #isOutside(AABBox) outside}.
- *
+ *
*
* Extracting the world-frustum planes from the P*Mv:
*
- *
+ *
* Fundamentals about Planes, Half-Spaces and Frustum-Culling:
*
* Planes and Half-Spaces, Max Wagner
@@ -69,7 +69,7 @@ import com.jogamp.common.os.Platform;
public class Frustum {
/** Normalized planes[l, r, b, t, n, f] */
protected Plane[] planes = new Plane[6];
-
+
/**
* Creates an undefined instance w/o calculating the frustum.
*
@@ -83,35 +83,35 @@ public class Frustum {
planes[i] = new Plane();
}
}
-
- /**
+
+ /**
* Plane equation := dot(n, x - p) = 0 -> ax + bc + cx + d == 0
*
* In order to work w/ {@link Frustum#isOutside(AABBox) isOutside(..)} methods,
* the normals have to point to the inside of the frustum.
- *
+ *
*/
public static class Plane {
/** Normal of the plane */
public final float[] n = new float[3];
-
+
/** Distance to origin */
public float d;
- /**
+ /**
* Return signed distance of plane to given point.
*
*
If dist < 0 , then the point p lies in the negative halfspace.
*
If dist = 0 , then the point p lies in the plane.
*
If dist > 0 , then the point p lies in the positive halfspace.
- *
+ *
* A plane cuts 3D space into 2 half spaces.
*
* Positive halfspace is where the plane’s normals vector points into.
- *
+ *
*
* Negative halfspace is the other side of the plane, i.e. *-1
- *
+ *
**/
public final float distanceTo(float x, float y, float z) {
return n[0] * x + n[1] * y + n[2] * z + d;
@@ -121,13 +121,13 @@ public class Frustum {
public final float distanceTo(float[] p) {
return n[0] * p[0] + n[1] * p[1] + n[2] * p[2] + d;
}
-
+
@Override
public String toString() {
return "Plane[ [ " + n[0] + ", " + n[1] + ", " + n[2] + " ], " + d + "]";
}
}
-
+
/** Index for left plane: {@value} */
public static final int LEFT = 0;
/** Index for right plane: {@value} */
@@ -140,7 +140,7 @@ public class Frustum {
public static final int NEAR = 4;
/** Index for far plane: {@value} */
public static final int FAR = 5;
-
+
/**
* {@link Plane}s are ordered in the returned array as follows:
*
@@ -154,17 +154,17 @@ public class Frustum {
*
* {@link Plane}'s normals are pointing to the inside of the frustum
* in order to work w/ {@link #isOutside(AABBox) isOutside(..)} methods.
- *
- *
- * @return array of normalized {@link Plane}s, order see above.
+ *
+ *
+ * @return array of normalized {@link Plane}s, order see above.
*/
public final Plane[] getPlanes() { return planes; }
-
+
/**
* Copy the given src planes into this this instance's planes.
* @param src the 6 source planes
*/
- public final void updateByPlanes(Plane[] src) {
+ public final void updateByPlanes(Plane[] src) {
for (int i = 0; i < 6; ++i) {
final Plane p0 = planes[i];
final float[] p0_n = p0.n;
@@ -176,7 +176,7 @@ public class Frustum {
p0.d = p1.d;
}
}
-
+
/**
* Calculate the frustum planes in world coordinates
* using the passed float[16] as premultiplied P*MV (column major order).
@@ -185,7 +185,7 @@ public class Frustum {
* as required by this class.
*
*/
- public void updateByPMV(float[] pmv, int pmv_off) {
+ public void updateByPMV(float[] pmv, int pmv_off) {
// Left: a = m41 + m11, b = m42 + m12, c = m43 + m13, d = m44 + m14 - [1..4] row-major
// Left: a = m30 + m00, b = m31 + m01, c = m32 + m02, d = m33 + m03 - [0..3] row-major
{
@@ -264,11 +264,11 @@ public class Frustum {
p.d /= invl;
}
}
-
+
private static final boolean isOutsideImpl(Plane p, AABBox box) {
final float[] low = box.getLow();
final float[] high = box.getHigh();
-
+
if ( p.distanceTo(low[0], low[1], low[2]) > 0.0f ||
p.distanceTo(high[0], low[1], low[2]) > 0.0f ||
p.distanceTo(low[0], high[1], low[2]) > 0.0f ||
@@ -298,19 +298,19 @@ public class Frustum {
// We make no attempt to determine whether it's fully inside or not.
return false;
}
-
-
+
+
public static enum Location { OUTSIDE, INSIDE, INTERSECT };
-
+
/**
* Check to see if a point is outside, inside or on a plane of the frustum.
- *
+ *
* @param p the point
* @return {@link Location} of point related to frustum planes
*/
public final Location classifyPoint(float[] p) {
Location res = Location.INSIDE;
-
+
for (int i = 0; i < 6; ++i) {
final float d = planes[i].distanceTo(p);
if ( d < 0.0f ) {
@@ -321,43 +321,43 @@ public class Frustum {
}
return res;
}
-
+
/**
* Check to see if a point is outside of the frustum.
- *
+ *
* @param p the point
* @return true if outside of the frustum, otherwise inside or on a plane
*/
public final boolean isPointOutside(float[] p) {
return Location.OUTSIDE == classifyPoint(p);
}
-
+
/**
* Check to see if a sphere is outside, intersecting or inside of the frustum.
- *
+ *
* @param p center of the sphere
* @param radius radius of the sphere
* @return {@link Location} of point related to frustum planes
*/
public final Location classifySphere(float[] p, float radius) {
Location res = Location.INSIDE; // fully inside
-
+
for (int i = 0; i < 6; ++i) {
final float d = planes[i].distanceTo(p);
- if ( d < -radius ) {
+ if ( d < -radius ) {
// fully outside
return Location.OUTSIDE;
} else if (d < radius ) {
// intersecting
res = Location.INTERSECT;
}
- }
+ }
return res;
}
-
+
/**
* Check to see if a sphere is outside of the frustum.
- *
+ *
* @param p center of the sphere
* @param radius radius of the sphere
* @return true if outside of the frustum, otherwise inside or intersecting
@@ -365,7 +365,7 @@ public class Frustum {
public final boolean isSphereOutside(float[] p, float radius) {
return Location.OUTSIDE == classifySphere(p, radius);
}
-
+
public StringBuilder toString(StringBuilder sb) {
if( null == sb ) {
sb = new StringBuilder();
@@ -380,7 +380,7 @@ public class Frustum {
.append("]");
return sb;
}
-
+
@Override
public String toString() {
return toString(null).toString();
diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
index ff764d849..33941a407 100644
--- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
+++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
@@ -102,11 +102,11 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
/* GL Stuff */
private final RecursiveLock lock = LockFactory.createRecursiveLock();
private final GLDrawableHelper helper = new GLDrawableHelper();
-
+
private final GLContext shareWith;
private final GLCapabilitiesImmutable capsRequested;
- private final GLCapabilitiesChooser capsChooser;
-
+ private final GLCapabilitiesChooser capsChooser;
+
private volatile Rectangle clientArea;
private volatile GLDrawableImpl drawable; // volatile: avoid locking for read-only access
private volatile GLContextImpl context;
@@ -156,7 +156,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
public void run() {
final RecursiveLock _lock = lock;
_lock.lock();
- try {
+ try {
if( !GLCanvas.this.isDisposed() ) {
helper.invokeGL(drawable, context, displayAction, initAction);
}
@@ -215,7 +215,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
gle.printStackTrace();
}
}
- context = null;
+ context = null;
}
if ( null != drawable ) {
drawable.setRealized(false);
@@ -261,11 +261,11 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
}
}
};
-
- /**
- * Creates an instance using {@link #GLCanvas(Composite, int, GLCapabilitiesImmutable, GLCapabilitiesChooser, GLContext)}
+
+ /**
+ * Creates an instance using {@link #GLCanvas(Composite, int, GLCapabilitiesImmutable, GLCapabilitiesChooser, GLContext)}
* on the SWT thread.
- *
+ *
* @param parent
* Required (non-null) parent Composite.
* @param style
@@ -284,7 +284,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
*/
public static GLCanvas create(final Composite parent, final int style, final GLCapabilitiesImmutable caps,
final GLCapabilitiesChooser chooser, final GLContext shareWith) {
- final GLCanvas[] res = new GLCanvas[] { null };
+ final GLCanvas[] res = new GLCanvas[] { null };
parent.getDisplay().syncExec(new Runnable() {
public void run() {
res[0] = new GLCanvas( parent, style, caps, chooser, shareWith );
@@ -319,22 +319,22 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
GLProfile.initSingleton(); // ensure JOGL is completly initialized
SWTAccessor.setRealized(this, true);
-
+
clientArea = GLCanvas.this.getClientArea();
- /* Get the nativewindow-Graphics Device associated with this control (which is determined by the parent Composite).
+ /* Get the nativewindow-Graphics Device associated with this control (which is determined by the parent Composite).
* Note: SWT is owner of the native handle, hence closing operation will be a NOP. */
final AbstractGraphicsDevice swtDevice = SWTAccessor.getDevice(this);
-
+
useX11GTK = SWTAccessor.useX11GTK();
if(useX11GTK) {
- // Decoupled X11 Device/Screen allowing X11 display lock-free off-thread rendering
+ // Decoupled X11 Device/Screen allowing X11 display lock-free off-thread rendering
final long x11DeviceHandle = X11Util.openDisplay(swtDevice.getConnection());
if( 0 == x11DeviceHandle ) {
throw new RuntimeException("Error creating display(EDT): "+swtDevice.getConnection());
}
final AbstractGraphicsDevice x11Device = new X11GraphicsDevice(x11DeviceHandle, AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
- screen = SWTAccessor.getScreen(x11Device, -1 /* default */);
+ screen = SWTAccessor.getScreen(x11Device, -1 /* default */);
} else {
screen = SWTAccessor.getScreen(swtDevice, -1 /* default */);
}
@@ -343,7 +343,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
if(null == capsReqUser) {
capsReqUser = new GLCapabilities(GLProfile.getDefault(screen.getDevice()));
}
-
+
this.capsRequested = capsReqUser;
this.capsChooser = capsChooser;
this.shareWith = shareWith;
@@ -353,7 +353,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
x11Window = 0;
drawable = null;
context = null;
-
+
final Listener listener = new Listener () {
@Override
public void handleEvent (Event event) {
@@ -374,7 +374,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
addListener (SWT.Paint, listener);
addListener (SWT.Dispose, listener);
}
-
+
private final UpstreamSurfaceHook swtCanvasUpStreamHook = new UpstreamSurfaceHook() {
@Override
public final void create(ProxySurface s) { /* nop */ }
@@ -401,11 +401,11 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
protected final void updateSizeCheck() {
final Rectangle oClientArea = clientArea;
final Rectangle nClientArea = GLCanvas.this.getClientArea();
- if ( nClientArea != null &&
+ if ( nClientArea != null &&
( nClientArea.width != oClientArea.width || nClientArea.height != oClientArea.height )
) {
clientArea = nClientArea; // write back new value
-
+
final GLDrawableImpl _drawable = drawable;
final boolean drawableOK = null != _drawable && _drawable.isRealized();
if(DEBUG) {
@@ -419,14 +419,14 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
try {
final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, nClientArea.width, nClientArea.height);
if(_drawable != _drawableNew) {
- // write back
+ // write back
drawable = _drawableNew;
}
} finally {
_lock.unlock();
}
- }
- }
+ }
+ }
if(0 != x11Window) {
SWTAccessor.resizeX11Window(screen.getDevice(), clientArea, x11Window);
} else if(0 != gdkWindow) {
@@ -435,36 +435,36 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
sendReshape = true; // async if display() doesn't get called below, but avoiding deadlock
}
}
-
+
private boolean isValidAndVisibleOnEDTActionResult;
private final Runnable isValidAndVisibleOnEDTAction = new Runnable() {
@Override
- public void run() {
+ public void run() {
isValidAndVisibleOnEDTActionResult = !GLCanvas.this.isDisposed() && GLCanvas.this.isVisible();
} };
-
+
private final boolean isValidAndVisibleOnEDT() {
synchronized(isValidAndVisibleOnEDTAction) {
runOnEDTIfAvail(true, isValidAndVisibleOnEDTAction);
return isValidAndVisibleOnEDTActionResult;
}
}
-
+
/** assumes drawable == null || !drawable.isRealized() ! Checks of !isDispose() and isVisible() */
protected final boolean validateDrawableAndContextWithCheck() {
if( !isValidAndVisibleOnEDT() ) {
return false;
}
- return validateDrawableAndContextPostCheck();
+ return validateDrawableAndContextPostCheck();
}
-
+
/** assumes drawable == null || !drawable.isRealized() ! No check of !isDispose() and isVisible() */
protected final boolean validateDrawableAndContextPostCheck() {
final Rectangle nClientArea = clientArea;
if(0 >= nClientArea.width || 0 >= nClientArea.height) {
return false;
}
-
+
final boolean res;
final RecursiveLock _lock = lock;
_lock.lock();
@@ -480,18 +480,18 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
}
} finally {
_lock.unlock();
- }
-
+ }
+
if(res) {
sendReshape = true;
if(DEBUG) {
System.err.println("SWT GLCanvas realized! "+this+", "+drawable);
// Thread.dumpStack();
- }
+ }
}
- return res;
+ return res;
}
-
+
private final void createDrawableAndContext() {
final AbstractGraphicsDevice device = screen.getDevice();
device.open();
@@ -503,14 +503,14 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
capsRequested, capsRequested, capsChooser, screen, VisualIDHolder.VID_UNDEFINED);
if(DEBUG) {
System.err.println("SWT.GLCanvas.X11 factory: "+factory+", chosen config: "+cfg);
- }
+ }
if (null == cfg) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
final int visualID = cfg.getVisualID(VIDType.NATIVE);
if( VisualIDHolder.VID_UNDEFINED != visualID ) {
// gdkWindow = SWTAccessor.createCompatibleGDKChildWindow(this, visualID, clientArea.width, clientArea.height);
- // nativeWindowHandle = SWTAccessor.gdk_window_get_xwindow(gdkWindow);
+ // nativeWindowHandle = SWTAccessor.gdk_window_get_xwindow(gdkWindow);
x11Window = SWTAccessor.createCompatibleX11ChildWindow(screen, this, visualID, clientArea.width, clientArea.height);
nativeWindowHandle = x11Window;
} else {
@@ -520,16 +520,16 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
nativeWindowHandle = SWTAccessor.getWindowHandle(this);
}
final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(capsRequested.getGLProfile());
-
+
// Create a NativeWindow proxy for the SWT canvas
- ProxySurface proxySurface = glFactory.createProxySurface(device, screen.getIndex(), nativeWindowHandle,
+ ProxySurface proxySurface = glFactory.createProxySurface(device, screen.getIndex(), nativeWindowHandle,
capsRequested, capsChooser, swtCanvasUpStreamHook);
// Associate a GL surface with the proxy
drawable = (GLDrawableImpl) glFactory.createGLDrawable(proxySurface);
context = (GLContextImpl) drawable.createContext(shareWith);
- context.setContextCreationFlags(additionalCtxCreationFlags);
+ context.setContextCreationFlags(additionalCtxCreationFlags);
}
-
+
@Override
public void update() {
// don't paint background etc .. nop avoids flickering
@@ -543,13 +543,13 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
if(r && 0 != gdkWindow) {
SWTGTKUtil.focusGDKWindow(gdkWindow);
}
- return r;
+ return r;
} */
-
+
@Override
public void dispose() {
runInGLThread(disposeOnEDTGLAction);
- super.dispose();
+ super.dispose();
}
private final void displayIfNoAnimatorNoCheck() {
@@ -557,14 +557,14 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
final boolean drawableOK = null != drawable && drawable.isRealized();
if( drawableOK || validateDrawableAndContextPostCheck() ) {
runInGLThread(makeCurrentAndDisplayOnGLAction);
- }
+ }
}
}
-
+
//
// GL[Auto]Drawable
//
-
+
@Override
public void display() {
final boolean drawableOK = null != drawable && drawable.isRealized();
@@ -577,7 +577,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
public final Object getUpstreamWidget() {
return this;
}
-
+
@Override
public int getWidth() {
return clientArea.width;
@@ -593,7 +593,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
final GLDrawable _drawable = drawable;
return null != _drawable ? _drawable.isGLOriented() : true;
}
-
+
@Override
public void addGLEventListener(final GLEventListener listener) {
helper.addGLEventListener(listener);
@@ -608,29 +608,29 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
public int getGLEventListenerCount() {
return helper.getGLEventListenerCount();
}
-
+
@Override
public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
return helper.getGLEventListener(index);
}
-
+
@Override
public boolean getGLEventListenerInitState(GLEventListener listener) {
return helper.getGLEventListenerInitState(listener);
}
-
+
@Override
public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
-
+
@Override
public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
runInGLThread(r);
return r.listener;
}
-
+
@Override
public GLEventListener removeGLEventListener(final GLEventListener listener) {
return helper.removeGLEventListener(listener);
@@ -673,7 +673,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
public final GLDrawable getDelegatedDrawable() {
return drawable;
}
-
+
@Override
public GLContext getContext() {
return null != drawable ? context : null;
@@ -694,12 +694,12 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
public boolean invoke(final boolean wait, final GLRunnable runnable) {
return helper.invoke(this, wait, runnable);
}
-
+
@Override
public boolean invoke(final boolean wait, final List runnables) {
return helper.invoke(this, wait, runnables);
}
-
+
@Override
public void setAnimator(final GLAnimatorControl arg0) throws GLException {
helper.setAnimator(arg0);
@@ -714,7 +714,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
final RecursiveLock _lock = lock;
_lock.lock();
- try {
+ try {
final GLContext oldCtx = context;
GLDrawableHelper.switchContext(drawable, oldCtx, destroyPrevCtx, newCtx, additionalCtxCreationFlags);
context=(GLContextImpl)newCtx;
@@ -761,7 +761,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
@Override
public GLCapabilitiesImmutable getChosenGLCapabilities() {
- final GLDrawable _drawable = drawable;
+ final GLDrawable _drawable = drawable;
return null != _drawable ? (GLCapabilitiesImmutable)_drawable.getChosenGLCapabilities() : null;
}
@@ -771,7 +771,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
* @return Non-null GLCapabilities.
*/
public GLCapabilitiesImmutable getRequestedGLCapabilities() {
- final GLDrawable _drawable = drawable;
+ final GLDrawable _drawable = drawable;
return null != _drawable ? (GLCapabilitiesImmutable)_drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities() : null;
}
@@ -788,7 +788,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
@Override
public long getHandle() {
- final GLDrawable _drawable = drawable;
+ final GLDrawable _drawable = drawable;
return (_drawable != null) ? _drawable.getHandle() : 0;
}
@@ -827,12 +827,12 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
*
*
*
Current thread
- *
+ *
*
- * The current thread seems to be valid for all platforms,
+ * The current thread seems to be valid for all platforms,
* since no SWT lifecycle tasks are being performed w/ this call.
* Only GL task, which are independent from the SWT threading model.
- *
+ *
* @see Platform#AWT_AVAILABLE
* @see Platform#getOSType()
*/
@@ -854,8 +854,8 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
} */
action.run();
}
-
- private void runOnEDTIfAvail(boolean wait, final Runnable action) {
+
+ private void runOnEDTIfAvail(boolean wait, final Runnable action) {
final Display d = isDisposed() ? null : getDisplay();
if( null == d || d.isDisposed() || d.getThread() == Thread.currentThread() ) {
action.run();
@@ -879,7 +879,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
",\n\tDrawable size "+dw+"x"+dh+
",\n\tSWT size "+getWidth()+"x"+getHeight()+"]";
}
-
+
public static void main(final String[] args) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
index 8de178e49..80289acf3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.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
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index 80d980492..cdfb73b21 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.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 @@ import javax.media.opengl.GLException;
* Call {@link #stop() } to terminate the animation and it's execution thread.
*
*/
-public class Animator extends AnimatorBase {
+public class Animator extends AnimatorBase {
protected ThreadGroup threadGroup;
private Runnable runnable;
private boolean runAsFastAsPossible;
@@ -75,7 +75,7 @@ public class Animator extends AnimatorBase {
}
}
- /**
+ /**
* Creates a new Animator w/ an associated ThreadGroup.
*/
public Animator(ThreadGroup tg) {
@@ -86,7 +86,7 @@ public class Animator extends AnimatorBase {
}
}
- /**
+ /**
* Creates a new Animator for a particular drawable.
*/
public Animator(GLAutoDrawable drawable) {
@@ -97,7 +97,7 @@ public class Animator extends AnimatorBase {
}
}
- /**
+ /**
* Creates a new Animator w/ an associated ThreadGroup for a particular drawable.
*/
public Animator(ThreadGroup tg, GLAutoDrawable drawable) {
@@ -127,7 +127,7 @@ public class Animator extends AnimatorBase {
stateSync.unlock();
}
}
-
+
private final void setIsAnimatingSynced(boolean v) {
stateSync.lock();
try {
@@ -185,7 +185,7 @@ public class Animator extends AnimatorBase {
}
if (!stopIssued && !isAnimating) {
// Wakes up 'waitForStartedCondition' sync
- // - and -
+ // - and -
// Resume from pause or drawablesEmpty,
// implies !pauseIssued and !drawablesEmpty
setIsAnimatingSynced(true); // barrier
@@ -251,7 +251,7 @@ public class Animator extends AnimatorBase {
/**
* Set a {@link ThreadGroup} for the {@link #getThread() animation thread}.
- *
+ *
* @param tg the {@link ThreadGroup}
* @throws GLException if the animator has already been started
*/
@@ -261,7 +261,7 @@ public class Animator extends AnimatorBase {
}
threadGroup = tg;
}
-
+
public synchronized boolean start() {
if ( isStartedImpl() ) {
return false;
@@ -277,7 +277,7 @@ public class Animator extends AnimatorBase {
} else {
thread = new Thread(threadGroup, runnable, threadName);
}
- thread.setDaemon(false); // force to be non daemon, regardless of parent thread
+ thread.setDaemon(false); // force to be non daemon, regardless of parent thread
if(DEBUG) {
final Thread ct = Thread.currentThread();
System.err.println("Animator "+ct.getName()+"[daemon "+ct.isDaemon()+"]: starting "+thread.getName()+"[daemon "+thread.isDaemon()+"]");
@@ -288,7 +288,7 @@ public class Animator extends AnimatorBase {
private final Condition waitForStartedCondition = new Condition() {
public boolean eval() {
return !isStartedImpl() || (!drawablesEmpty && !isAnimating) ;
- } };
+ } };
public synchronized boolean stop() {
if ( !isStartedImpl() ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
index ef92100ad..b447a339b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
@@ -52,14 +52,14 @@ import javax.media.opengl.GLProfile;
*/
public abstract class AnimatorBase implements GLAnimatorControl {
protected static final boolean DEBUG = Debug.debug("Animator");
-
+
/** A 1s timeout while waiting for a native action response, limiting {@link #finishLifecycleAction(Condition, long)} */
protected static final long TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION = 1000;
-
+
protected static final long POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION = 32; // 2 frames @ 60Hz
-
+
/**
- * If present in modeBits field and
+ * If present in modeBits field and
* {@link GLProfile#isAWTAvailable() AWT is available},
* implementation is aware of the AWT EDT, otherwise not.
*
@@ -67,8 +67,8 @@ public abstract class AnimatorBase implements GLAnimatorControl {
*
* @see #setModeBits(boolean, int)
*/
- public static final int MODE_EXPECT_AWT_RENDERING_THREAD = 1 << 0;
-
+ public static final int MODE_EXPECT_AWT_RENDERING_THREAD = 1 << 0;
+
public interface AnimatorImpl {
void display(ArrayList drawables, boolean ignoreExceptions, boolean printExceptions);
boolean blockUntilDone(Thread thread);
@@ -77,7 +77,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
protected int modeBits;
protected AnimatorImpl impl;
protected String baseName;
-
+
protected ArrayList drawables = new ArrayList();
protected boolean drawablesEmpty;
protected Thread animThread;
@@ -85,10 +85,10 @@ public abstract class AnimatorBase implements GLAnimatorControl {
protected boolean printExceptions;
protected boolean exclusiveContext;
protected Thread userExclusiveContextThread;
- protected FPSCounterImpl fpsCounter = new FPSCounterImpl();
+ protected FPSCounterImpl fpsCounter = new FPSCounterImpl();
protected RecursiveLock stateSync = LockFactory.createRecursiveLock();
-
- private final static Class> awtAnimatorImplClazz;
+
+ private final static Class> awtAnimatorImplClazz;
static {
GLProfile.initSingleton();
if( GLProfile.isAWTAvailable() ) {
@@ -96,7 +96,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
try {
clazz = Class.forName("com.jogamp.opengl.util.AWTAnimatorImpl");
} catch (Exception e) {
- clazz = null;
+ clazz = null;
}
awtAnimatorImplClazz = clazz;
} else {
@@ -105,29 +105,29 @@ public abstract class AnimatorBase implements GLAnimatorControl {
}
/**
- * Creates a new, empty Animator instance
+ * Creates a new, empty Animator instance
* while expecting an AWT rendering thread if AWT is available.
- *
+ *
* @see GLProfile#isAWTAvailable()
*/
public AnimatorBase() {
- modeBits = MODE_EXPECT_AWT_RENDERING_THREAD; // default!
+ modeBits = MODE_EXPECT_AWT_RENDERING_THREAD; // default!
drawablesEmpty = true;
}
-
+
private static final boolean useAWTAnimatorImpl(int modeBits) {
return 0 != ( MODE_EXPECT_AWT_RENDERING_THREAD & modeBits ) && null != awtAnimatorImplClazz;
}
-
+
/**
* Initializes implementation details post setup,
* invoked at {@link #add(GLAutoDrawable)}, {@link #start()}, ..
*
- * Operation is a NOP if force is false
+ * Operation is a NOP if force is false
* and this instance is already initialized.
- *
- *
- * @throws GLException if Animator is {@link #isStarted()}
+ *
+ *
+ * @throws GLException if Animator is {@link #isStarted()}
*/
protected synchronized void initImpl(boolean force) {
if( force || null == impl ) {
@@ -153,8 +153,8 @@ public abstract class AnimatorBase implements GLAnimatorControl {
* in this Animators modeBits.
* @param enable
* @param bitValues
- *
- * @throws GLException if Animator is {@link #isStarted()} and {@link #MODE_EXPECT_AWT_RENDERING_THREAD} about to change
+ *
+ * @throws GLException if Animator is {@link #isStarted()} and {@link #MODE_EXPECT_AWT_RENDERING_THREAD} about to change
* @see AnimatorBase#MODE_EXPECT_AWT_RENDERING_THREAD
*/
public synchronized void setModeBits(boolean enable, int bitValues) throws GLException {
@@ -172,8 +172,8 @@ public abstract class AnimatorBase implements GLAnimatorControl {
}
}
public synchronized int getModeBits() { return modeBits; }
-
-
+
+
@Override
public synchronized void add(final GLAutoDrawable drawable) {
if(DEBUG) {
@@ -190,7 +190,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
drawables.add(drawable);
drawablesEmpty = drawables.size() == 0;
drawable.setAnimator(this);
- if( isPaused() ) { // either paused by pause() above, or if previously drawablesEmpty==true
+ if( isPaused() ) { // either paused by pause() above, or if previously drawablesEmpty==true
resume();
}
final Condition waitForAnimatingAndECTCondition = new Condition() {
@@ -213,7 +213,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
if( !drawables.contains(drawable) ) {
throw new IllegalArgumentException("Drawable not added to animator: "+this+", "+drawable);
}
-
+
if( exclusiveContext && isAnimating() ) {
drawable.setExclusiveContextThread( null );
final Condition waitForNullECTCondition = new Condition() {
@@ -244,7 +244,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
return isStarted() && drawablesEmpty && isAnimating();
} };
-
+
/**
* Dedicate all {@link GLAutoDrawable}'s context to the given exclusive context thread.
*
@@ -252,14 +252,14 @@ public abstract class AnimatorBase implements GLAnimatorControl {
*
*
* If already started and disabling, method waits
- * until change is propagated to all {@link GLAutoDrawable} if not
+ * until change is propagated to all {@link GLAutoDrawable} if not
* called from the animator thread or {@link #getExclusiveContextThread() exclusive context thread}.
*
*
* Note: Utilizing this feature w/ AWT could lead to an AWT-EDT deadlock, depending on the AWT implementation.
* Hence it is advised not to use it with native AWT GLAutoDrawable like GLCanvas.
*
- *
+ *
* @param enable
* @return previous value
* @see #setExclusiveContext(boolean)
@@ -272,7 +272,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
final boolean enable = null != t;
stateSync.lock();
try {
- old = userExclusiveContextThread;
+ old = userExclusiveContextThread;
if( enable && t != animThread ) { // disable: will be cleared at end after propagation && filter out own animThread usae
userExclusiveContextThread=t;
}
@@ -282,7 +282,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
setExclusiveContext(enable);
return old;
}
-
+
/**
* Dedicate all {@link GLAutoDrawable}'s context to this animator thread.
*
@@ -290,14 +290,14 @@ public abstract class AnimatorBase implements GLAnimatorControl {
*
*
* If already started and disabling, method waits
- * until change is propagated to all {@link GLAutoDrawable} if not
+ * until change is propagated to all {@link GLAutoDrawable} if not
* called from the animator thread or {@link #getExclusiveContextThread() exclusive context thread}.
*
*
* Note: Utilizing this feature w/ AWT could lead to an AWT-EDT deadlock, depending on the AWT implementation.
* Hence it is advised not to use it with native AWT GLAutoDrawable like GLCanvas.
*
- *
+ *
* @param enable
* @return previous value
* @see #setExclusiveContext(Thread)
@@ -349,24 +349,24 @@ public abstract class AnimatorBase implements GLAnimatorControl {
System.err.println("AnimatorBase.setExclusiveContextThread: all-GLAD Ok: "+validateDrawablesExclCtxState(dECT)+", "+this);
}
return oldExclusiveContext;
- }
-
+ }
+
/**
* Returns true, if the exclusive context thread is enabled, otherwise false.
- *
+ *
* @see #setExclusiveContext(boolean)
* @see #setExclusiveContext(Thread)
*/
// @Override
- public final boolean isExclusiveContextEnabled() {
+ public final boolean isExclusiveContextEnabled() {
stateSync.lock();
try {
- return exclusiveContext;
+ return exclusiveContext;
} finally {
stateSync.unlock();
}
}
-
+
/**
* Returns the exclusive context thread if {@link #isExclusiveContextEnabled()} and {@link #isStarted()}, otherwise null.
*
@@ -381,7 +381,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
* @see #setExclusiveContext(Thread)
*/
// @Override
- public final Thread getExclusiveContextThread() {
+ public final Thread getExclusiveContextThread() {
stateSync.lock();
try {
return ( isStartedImpl() && exclusiveContext ) ? ( null != userExclusiveContextThread ? userExclusiveContextThread : animThread ) : null ;
@@ -389,7 +389,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
stateSync.unlock();
}
}
-
+
/**
* Should be called at {@link #start()} and {@link #stop()}
* from within the animator thread.
@@ -407,7 +407,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
for (int i=0; ifalse.
- * @param pollPeriod if 0, method will wait until TO is reached or being notified.
+ * @param pollPeriod if 0, method will wait until TO is reached or being notified.
* if > 0, method will wait for the given pollPeriod in milliseconds.
* @return true if {@link Condition#eval() waitCondition.eval()} returned false, otherwise false.
*/
@@ -545,11 +545,11 @@ public abstract class AnimatorBase implements GLAnimatorControl {
if( remaining<=0 && nok ) {
System.err.println("finishLifecycleAction(" + waitCondition.getClass().getName() + "): ++++++ timeout reached ++++++ " + getThreadName());
}
- stateSync.lock(); // avoid too many lock/unlock ops
+ stateSync.lock(); // avoid too many lock/unlock ops
try {
System.err.println("finishLifecycleAction(" + waitCondition.getClass().getName() + "): OK "+(!nok)+
"- pollPeriod "+pollPeriod+", blocking "+blocking+
- ", waited " + (blocking ? ( TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION - remaining ) : 0 ) + "/" + TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION +
+ ", waited " + (blocking ? ( TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION - remaining ) : 0 ) + "/" + TO_WAIT_FOR_FINISH_LIFECYCLE_ACTION +
" - " + getThreadName());
System.err.println(" - "+toString());
} finally {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
index bbd2951b9..0477e1903 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.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
diff --git a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
index 7613efec6..b48169c27 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.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.
*/
@@ -45,10 +45,10 @@ import java.util.TimerTask;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLException;
-/**
+/**
* An Animator subclass which attempts to achieve a target
* frames-per-second rate to avoid using all CPU time. The target FPS
- * is only an estimate and is not guaranteed.
+ * is only an estimate and is not guaranteed.
*
* The Animator execution thread does not run as a daemon thread,
* so it is able to keep an application from terminating.
@@ -105,45 +105,45 @@ public class FPSAnimator extends AnimatorBase {
* @param fps
* @throws GLException if the animator has already been started
*/
- public final synchronized void setFPS(int fps) throws GLException {
+ public final synchronized void setFPS(int fps) throws GLException {
if ( isStartedImpl() ) {
throw new GLException("Animator already started.");
}
- this.fps = fps;
+ this.fps = fps;
}
public final int getFPS() { return fps; }
-
+
class MainTask extends TimerTask {
private boolean justStarted;
private boolean alreadyStopped;
private boolean alreadyPaused;
-
+
public MainTask() {
}
-
+
public void start(Timer timer) {
fpsCounter.resetFPSCounter();
shouldRun = true;
shouldStop = false;
-
+
justStarted = true;
alreadyStopped = false;
alreadyPaused = false;
- final long period = 0 < fps ? (long) (1000.0f / (float) fps) : 1; // 0 -> 1: IllegalArgumentException: Non-positive period
+ final long period = 0 < fps ? (long) (1000.0f / (float) fps) : 1; // 0 -> 1: IllegalArgumentException: Non-positive period
if (scheduleAtFixedRate) {
timer.scheduleAtFixedRate(this, 0, period);
} else {
timer.schedule(this, 0, period);
}
}
-
+
public boolean isActive() { return !alreadyStopped && !alreadyPaused; }
-
+
public String toString() {
return "Task[thread "+animThread+", stopped "+alreadyStopped+", paused "+alreadyPaused+" shouldRun "+shouldRun+", shouldStop "+shouldStop+" -- started "+isStartedImpl()+", animating "+isAnimatingImpl()+", paused "+isPausedImpl()+", drawable "+drawables.size()+", drawablesEmpty "+drawablesEmpty+"]";
}
-
+
public void run() {
if( justStarted ) {
justStarted = false;
@@ -167,8 +167,8 @@ public class FPSAnimator extends AnimatorBase {
display();
} else if( shouldStop ) { // STOP
System.err.println("FPSAnimator P4: "+alreadyStopped+", "+ Thread.currentThread() + ": " + toString());
- this.cancel();
-
+ this.cancel();
+
if( !alreadyStopped ) {
alreadyStopped = true;
if( exclusiveContext && !drawablesEmpty ) {
@@ -184,23 +184,23 @@ public class FPSAnimator extends AnimatorBase {
FPSAnimator.this.notifyAll();
}
}
- } else {
+ } else {
System.err.println("FPSAnimator P5: "+alreadyPaused+", "+ Thread.currentThread() + ": " + toString());
this.cancel();
-
+
if( !alreadyPaused ) { // PAUSE
alreadyPaused = true;
if( exclusiveContext && !drawablesEmpty ) {
setDrawablesExclCtxState(false);
display(); // propagate exclusive change!
}
- synchronized (FPSAnimator.this) {
+ synchronized (FPSAnimator.this) {
if(DEBUG) {
System.err.println("FPSAnimator pause " + Thread.currentThread() + ": " + toString());
}
isAnimating = false;
FPSAnimator.this.notifyAll();
- }
+ }
}
}
}
@@ -230,7 +230,7 @@ public class FPSAnimator extends AnimatorBase {
}
static int timerNo = 0;
-
+
public synchronized boolean start() {
if ( null != timer || null != task || isStartedImpl() ) {
return false;
@@ -241,8 +241,8 @@ public class FPSAnimator extends AnimatorBase {
System.err.println("FPSAnimator.start() START: "+task+", "+ Thread.currentThread() + ": " + toString());
}
task.start(timer);
-
- final boolean res = finishLifecycleAction( drawablesEmpty ? waitForStartedEmptyCondition : waitForStartedAddedCondition,
+
+ final boolean res = finishLifecycleAction( drawablesEmpty ? waitForStartedEmptyCondition : waitForStartedAddedCondition,
POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION);
if(DEBUG) {
System.err.println("FPSAnimator.start() END: "+task+", "+ Thread.currentThread() + ": " + toString());
@@ -256,11 +256,11 @@ public class FPSAnimator extends AnimatorBase {
private final Condition waitForStartedAddedCondition = new Condition() {
public boolean eval() {
return !isStartedImpl() || !isAnimating ;
- } };
+ } };
private final Condition waitForStartedEmptyCondition = new Condition() {
public boolean eval() {
return !isStartedImpl() || isAnimating ;
- } };
+ } };
/** Stops this FPSAnimator. Due to the implementation of the
FPSAnimator it is not guaranteed that the FPSAnimator will be
@@ -268,7 +268,7 @@ public class FPSAnimator extends AnimatorBase {
public synchronized boolean stop() {
if ( null == timer || !isStartedImpl() ) {
return false;
- }
+ }
if(DEBUG) {
System.err.println("FPSAnimator.stop() START: "+task+", "+ Thread.currentThread() + ": " + toString());
}
@@ -281,7 +281,7 @@ public class FPSAnimator extends AnimatorBase {
shouldStop = true;
res = finishLifecycleAction(waitForStoppedCondition, POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION);
}
-
+
if(DEBUG) {
System.err.println("FPSAnimator.stop() END: "+task+", "+ Thread.currentThread() + ": " + toString());
}
@@ -316,7 +316,7 @@ public class FPSAnimator extends AnimatorBase {
shouldRun = false;
res = finishLifecycleAction(waitForPausedCondition, POLLP_WAIT_FOR_FINISH_LIFECYCLE_ACTION);
}
-
+
if(DEBUG) {
System.err.println("FPSAnimator.pause() END: "+task+", "+ Thread.currentThread() + ": " + toString());
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
index e0bbbc33c..2d685a1a8 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
@@ -53,13 +53,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
* and starting with a new created Buffer object with initialElementCount size
*
* On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
- * On profile ES2 the fixed function emulation will transform these calls to
+ * On profile ES2 the fixed function emulation will transform these calls to
* EnableVertexAttribArray and VertexAttribPointer calls,
* and a predefined vertex attribute variable name will be chosen.
- *
- * The default name mapping will be used,
+ *
+ * The default name mapping will be used,
* see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}.
- *
+ *
* @param index The GL array index
* @param comps The array component number
* @param dataType The array index GL data type
@@ -67,7 +67,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
* @param initialElementCount
*
* @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
- */
+ */
public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int initialElementCount)
throws GLException
{
@@ -82,13 +82,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
* and starting with a given Buffer object incl it's stride
*
* On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
- * On profile ES2 the fixed function emulation will transform these calls to
+ * On profile ES2 the fixed function emulation will transform these calls to
* EnableVertexAttribArray and VertexAttribPointer calls,
* and a predefined vertex attribute variable name will be chosen.
- *
- * The default name mapping will be used,
+ *
+ * The default name mapping will be used,
* see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}.
- *
+ *
* @param index The GL array index
* @param comps The array component number
* @param dataType The array index GL data type
@@ -97,8 +97,8 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
* @param buffer the user define data
*
* @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
- */
- public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int stride,
+ */
+ public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int stride,
Buffer buffer)
throws GLException
{
@@ -111,13 +111,13 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
/**
* Create a client side buffer object, using a custom GLSL array attribute name
* and starting with a new created Buffer object with initialElementCount size
- * @param name The custom name for the GL attribute.
+ * @param name The custom name for the GL attribute.
* @param comps The array component number
* @param dataType The array index GL data type
* @param normalized Whether the data shall be normalized
* @param initialElementCount
*/
- public static GLArrayDataClient createGLSL(String name, int comps,
+ public static GLArrayDataClient createGLSL(String name, int comps,
int dataType, boolean normalized, int initialElementCount)
throws GLException
{
@@ -130,7 +130,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
/**
* Create a client side buffer object, using a custom GLSL array attribute name
* and starting with a given Buffer object incl it's stride
- * @param name The custom name for the GL attribute.
+ * @param name The custom name for the GL attribute.
* @param comps The array component number
* @param dataType The array index GL data type
* @param normalized Whether the data shall be normalized
@@ -157,8 +157,8 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
}
}
}
-
- //
+
+ //
// Data read access
//
@@ -167,7 +167,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
@Override
public final boolean sealed() { return sealed; }
-
+
@Override
public final boolean enabled() { return bufferEnabled; }
@@ -195,10 +195,10 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
seal(seal);
enableBuffer(gl, seal);
}
-
+
@Override
public void enableBuffer(GL gl, boolean enable) {
- if( enableBufferAlways || bufferEnabled != enable ) {
+ if( enableBufferAlways || bufferEnabled != enable ) {
if(enable) {
checkSeal(true);
// init/generate VBO name if not done yet
@@ -208,7 +208,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
bufferEnabled = enable;
}
}
-
+
@Override
public boolean bindBuffer(GL gl, boolean bind) {
if(bind) {
@@ -218,7 +218,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
}
return glArrayHandler.bindBuffer(gl, bind);
}
-
+
@Override
public void setEnableAlways(boolean always) {
enableBufferAlways = always;
@@ -328,15 +328,15 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
", isVertexAttribute "+isVertexAttribute+
", usesGLSL "+usesGLSL+
", usesShaderState "+(null!=shaderState)+
- ", dataType 0x"+Integer.toHexString(componentType)+
- ", bufferClazz "+componentClazz+
+ ", dataType 0x"+Integer.toHexString(componentType)+
+ ", bufferClazz "+componentClazz+
", elements "+getElementCount()+
- ", components "+components+
+ ", components "+components+
", stride "+strideB+"b "+strideL+"c"+
- ", initialElementCount "+initialElementCount+
- ", sealed "+sealed+
- ", bufferEnabled "+bufferEnabled+
- ", bufferWritten "+bufferWritten+
+ ", initialElementCount "+initialElementCount+
+ ", sealed "+sealed+
+ ", bufferEnabled "+bufferEnabled+
+ ", bufferWritten "+bufferWritten+
", buffer "+buffer+
", alive "+alive+
"]";
@@ -345,16 +345,16 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
// non public matters
protected final boolean growBufferIfNecessary(int spare) {
- if(buffer==null || buffer.remaining()enable is true,
+ * Enables the buffer if enable is true,
* and transfers the data if required.
* In case {@link #isVBO() VBO is used}, it is bound accordingly for the data transfer and association,
* i.e. it issued {@link #bindBuffer(GL, boolean)}.
- * The VBO buffer is unbound when the method returns.
+ * The VBO buffer is unbound when the method returns.
*
- * Disables the buffer if enable is false.
+ * Disables the buffer if enable is false.
*
- *
+ *
*
The action will only be executed,
- * if the internal enable state differs,
+ * if the internal enable state differs,
* or 'setEnableAlways' was called with 'true'.
- *
+ *
*
It is up to the user to enable/disable the array properly,
* ie in case of multiple data sets for the same vertex attribute (VA).
* Meaning in such case usage of one set while expecting another one
@@ -68,7 +68,7 @@ public interface GLArrayDataEditable extends GLArrayData {
public void enableBuffer(GL gl, boolean enable);
/**
- * if bind is true and the data uses {@link #isVBO() VBO},
+ * if bind is true and the data uses {@link #isVBO() VBO},
* the latter will be bound and data written to the GPU if required.
*
* If bind is false and the data uses {@link #isVBO() VBO},
@@ -79,11 +79,11 @@ public interface GLArrayDataEditable extends GLArrayData {
* to be bounded and written while keeping the VBO bound. The latter is in contrast to {@link #enableBuffer(GL, boolean)},
* which leaves the VBO unbound, since it's not required for vertex attributes or pointers.
*
- *
+ *
* @param gl current GL object
- * @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
+ * @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
*/
public boolean bindBuffer(GL gl, boolean bind);
@@ -92,7 +92,7 @@ public interface GLArrayDataEditable extends GLArrayData {
*
* The default is 'false'
*
- * This is useful when you mix up
+ * This is useful when you mix up
* GLArrayData usage with conventional GL array calls
* or in case of a buggy GL VBO implementation.
*
@@ -117,7 +117,7 @@ public interface GLArrayDataEditable extends GLArrayData {
* ie position:=limit and limit:=capacity.
*
* @see #seal(boolean)
- */
+ */
public void seal(boolean seal);
public void rewind();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
index 7e7d27b36..80639c5c7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
@@ -57,13 +57,13 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* and starting with a given Buffer object incl it's stride
*
* On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
- * On profile ES2 the fixed function emulation will transform these calls to
+ * On profile ES2 the fixed function emulation will transform these calls to
* EnableVertexAttribArray and VertexAttribPointer calls,
* and a predefined vertex attribute variable name will be chosen.
- *
- * The default name mapping will be used,
+ *
+ * The default name mapping will be used,
* see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}.
- *
+ *
* @param index The GL array index
* @param comps The array component number
* @param dataType The array index GL data type
@@ -90,13 +90,13 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* and starting with a new created Buffer object with initialElementCount size
*
* On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
- * On profile ES2 the fixed function emulation will transform these calls to
+ * On profile ES2 the fixed function emulation will transform these calls to
* EnableVertexAttribArray and VertexAttribPointer calls,
* and a predefined vertex attribute variable name will be chosen.
- *
- * The default name mapping will be used,
+ *
+ * The default name mapping will be used,
* see {@link GLPointerFuncUtil#getPredefinedArrayIndexName(int)}.
- *
+ *
* @param index The GL array index
* @param comps The array component number
* @param dataType The array index GL data type
@@ -106,7 +106,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
*
* @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
*/
- public static GLArrayDataServer createFixed(int index, int comps, int dataType, boolean normalized, int initialElementCount,
+ public static GLArrayDataServer createFixed(int index, int comps, int dataType, boolean normalized, int initialElementCount,
int vboUsage)
throws GLException
{
@@ -120,7 +120,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
/**
* Create a VBO, using a custom GLSL array attribute name
* and starting with a new created Buffer object with initialElementCount size
- * @param name The custom name for the GL attribute
+ * @param name The custom name for the GL attribute
* @param comps The array component number
* @param dataType The array index GL data type
* @param normalized Whether the data shall be normalized
@@ -128,20 +128,20 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
public static GLArrayDataServer createGLSL(String name, int comps,
- int dataType, boolean normalized, int initialElementCount, int vboUsage)
- throws GLException
+ int dataType, boolean normalized, int initialElementCount, int vboUsage)
+ throws GLException
{
GLArrayDataServer ads = new GLArrayDataServer();
GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
ads.init(name, -1, comps, dataType, normalized, 0, null, initialElementCount,
true, glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
return ads;
- }
-
+ }
+
/**
* Create a VBO, using a custom GLSL array attribute name
* and starting with a given Buffer object incl it's stride
- * @param name The custom name for the GL attribute
+ * @param name The custom name for the GL attribute
* @param comps The array component number
* @param dataType The array index GL data type
* @param normalized Whether the data shall be normalized
@@ -151,7 +151,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
*/
public static GLArrayDataServer createGLSL(String name, int comps,
int dataType, boolean normalized, int stride, Buffer buffer,
- int vboUsage)
+ int vboUsage)
throws GLException
{
GLArrayDataServer ads = new GLArrayDataServer();
@@ -160,12 +160,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
return ads;
}
-
+
/**
* Create a VBO data object for any target w/o render pipeline association, ie {@link GL#GL_ELEMENT_ARRAY_BUFFER}.
- *
+ *
* Hence no index, name for a fixed function pipeline nor vertex attribute is given.
- *
+ *
* @param comps The array component number
* @param dataType The array index GL data type
* @param stride
@@ -187,16 +187,16 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
/**
* Create a VBO data object for any target w/o render pipeline association, ie {@link GL#GL_ELEMENT_ARRAY_BUFFER}.
- *
+ *
* Hence no index, name for a fixed function pipeline nor vertex attribute is given.
- *
+ *
* @param comps The array component number
* @param dataType The array index GL data type
* @param initialElementCount
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
* @param vboTarget {@link GL#GL_ELEMENT_ARRAY_BUFFER}, ..
*/
- public static GLArrayDataServer createData(int comps, int dataType, int initialElementCount,
+ public static GLArrayDataServer createData(int comps, int dataType, int initialElementCount,
int vboUsage, int vboTarget)
throws GLException
{
@@ -207,19 +207,19 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
return ads;
}
-
+
/**
* Create a VBO for fixed function interleaved array data
* starting with a new created Buffer object with initialElementCount size.
*
User needs to configure the interleaved segments via {@link #addFixedSubArray(int, int, int)}.
- *
+ *
* @param comps The total number of all interleaved components.
* @param dataType The array index GL data type
* @param normalized Whether the data shall be normalized
- * @param initialElementCount
+ * @param initialElementCount
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createFixedInterleaved(int comps, int dataType, boolean normalized, int initialElementCount,
+ public static GLArrayDataServer createFixedInterleaved(int comps, int dataType, boolean normalized, int initialElementCount,
int vboUsage)
throws GLException
{
@@ -239,7 +239,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* The memory of the the interleaved array is being used.
*
* Must be called before using the array, eg: {@link #seal(boolean)}, {@link #putf(float)}, ..
- *
+ *
* @param index The GL array index, maybe -1 if vboTarget is {@link GL#GL_ELEMENT_ARRAY_BUFFER}
* @param comps This interleaved array segment's component number
* @param vboTarget {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
@@ -250,32 +250,32 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
throw new GLException("Interleaved offset > total components ("+iOffC+" > "+getComponentCount()+")");
}
if(usesGLSL) {
- throw new GLException("buffer uses GLSL");
+ throw new GLException("buffer uses GLSL");
}
final GLArrayDataWrapper ad = GLArrayDataWrapper.createFixed(
- index, comps, getComponentType(),
- getNormalized(), getStride(), getBuffer(),
+ index, comps, getComponentType(),
+ getNormalized(), getStride(), getBuffer(),
getVBOName(), interleavedOffset, getVBOUsage(), vboTarget);
ad.setVBOEnabled(isVBO());
interleavedOffset += comps * getComponentSizeInBytes();
- if(GL.GL_ARRAY_BUFFER == vboTarget) {
+ if(GL.GL_ARRAY_BUFFER == vboTarget) {
glArrayHandler.addSubHandler(new GLFixedArrayHandlerFlat(ad));
}
return ad;
}
-
+
/**
* Create a VBO for GLSL interleaved array data
* starting with a new created Buffer object with initialElementCount size.
*
User needs to configure the interleaved segments via {@link #addGLSLSubArray(int, int, int)}.
- *
+ *
* @param comps The total number of all interleaved components.
* @param dataType The array index GL data type
* @param normalized Whether the data shall be normalized
- * @param initialElementCount
+ * @param initialElementCount
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createGLSLInterleaved(int comps, int dataType, boolean normalized, int initialElementCount,
+ public static GLArrayDataServer createGLSLInterleaved(int comps, int dataType, boolean normalized, int initialElementCount,
int vboUsage)
throws GLException
{
@@ -285,7 +285,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
return ads;
}
-
+
/**
* Configure a segment of this GLSL interleaved array (see {@link #createGLSLInterleaved(int, int, boolean, int, int)}).
*
@@ -305,20 +305,20 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
throw new GLException("Interleaved offset > total components ("+iOffC+" > "+getComponentCount()+")");
}
if(!usesGLSL) {
- throw new GLException("buffer uses fixed function");
+ throw new GLException("buffer uses fixed function");
}
final GLArrayDataWrapper ad = GLArrayDataWrapper.createGLSL(
- name, comps, getComponentType(),
- getNormalized(), getStride(), getBuffer(),
- getVBOName(), interleavedOffset, getVBOUsage(), vboTarget);
+ name, comps, getComponentType(),
+ getNormalized(), getStride(), getBuffer(),
+ getVBOName(), interleavedOffset, getVBOUsage(), vboTarget);
ad.setVBOEnabled(isVBO());
interleavedOffset += comps * getComponentSizeInBytes();
- if(GL.GL_ARRAY_BUFFER == vboTarget) {
+ if(GL.GL_ARRAY_BUFFER == vboTarget) {
glArrayHandler.addSubHandler(new GLSLArrayHandlerFlat(ad));
}
return ad;
}
-
+
//
// Data matters GLArrayData
//
@@ -341,15 +341,15 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
}
//
- // data matters
+ // data matters
//
/**
- * Convenient way do disable the VBO behavior and
+ * Convenient way do disable the VBO behavior and
* switch to client side data one
* Only possible if buffer is defined.
*/
- public void setVBOEnabled(boolean vboUsage) {
+ public void setVBOEnabled(boolean vboUsage) {
checkSeal(false);
super.setVBOEnabled(vboUsage);
}
@@ -361,22 +361,22 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
", isVertexAttribute "+isVertexAttribute+
", usesGLSL "+usesGLSL+
", usesShaderState "+(null!=shaderState)+
- ", dataType 0x"+Integer.toHexString(componentType)+
- ", bufferClazz "+componentClazz+
+ ", dataType 0x"+Integer.toHexString(componentType)+
+ ", bufferClazz "+componentClazz+
", elements "+getElementCount()+
- ", components "+components+
+ ", components "+components+
", stride "+strideB+"b "+strideL+"c"+
", initialElementCount "+initialElementCount+
- ", vboEnabled "+vboEnabled+
- ", vboName "+vboName+
- ", vboUsage 0x"+Integer.toHexString(vboUsage)+
- ", vboTarget 0x"+Integer.toHexString(vboTarget)+
- ", vboOffset "+vboOffset+
- ", sealed "+sealed+
- ", bufferEnabled "+bufferEnabled+
- ", bufferWritten "+bufferWritten+
- ", buffer "+buffer+
- ", alive "+alive+
+ ", vboEnabled "+vboEnabled+
+ ", vboName "+vboName+
+ ", vboUsage 0x"+Integer.toHexString(vboUsage)+
+ ", vboTarget 0x"+Integer.toHexString(vboTarget)+
+ ", vboOffset "+vboOffset+
+ ", sealed "+sealed+
+ ", bufferEnabled "+bufferEnabled+
+ ", bufferWritten "+bufferWritten+
+ ", buffer "+buffer+
+ ", alive "+alive+
"]";
}
@@ -384,7 +384,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
// non public matters ..
//
- protected void init(String name, int index, int comps, int dataType, boolean normalized,
+ protected void init(String name, int index, int comps, int dataType, boolean normalized,
int stride, Buffer data, int initialElementCount, boolean isVertexAttribute,
GLArrayHandler glArrayHandler,
int vboName, long vboOffset, int vboUsage, int vboTarget, boolean usesGLSL)
@@ -407,7 +407,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
}
}
}
-
- private int interleavedOffset = 0;
+
+ private int interleavedOffset = 0;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
index f8b17501e..290f47a6d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
@@ -49,7 +49,7 @@ public class GLArrayDataWrapper implements GLArrayData {
/**
* Create a VBO, using a predefined fixed function array index, wrapping the given data.
- *
+ *
* @param index The GL array index
* @param comps The array component number
* @param dataType The array index GL data type
@@ -61,23 +61,23 @@ public class GLArrayDataWrapper implements GLArrayData {
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
* @param vboTarget {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
* @return the new create instance
- *
+ *
* @throws GLException
*/
- public static GLArrayDataWrapper createFixed(int index, int comps, int dataType, boolean normalized, int stride,
+ public static GLArrayDataWrapper createFixed(int index, int comps, int dataType, boolean normalized, int stride,
Buffer buffer, int vboName, long vboOffset, int vboUsage, int vboTarget)
throws GLException
{
GLArrayDataWrapper adc = new GLArrayDataWrapper();
- adc.init(null, index, comps, dataType, normalized, stride, buffer, false,
+ adc.init(null, index, comps, dataType, normalized, stride, buffer, false,
vboName, vboOffset, vboUsage, vboTarget);
return adc;
}
/**
* Create a VBO, using a custom GLSL array attribute name, wrapping the given data.
- *
- * @param name The custom name for the GL attribute, maybe null if gpuBufferTarget is {@link GL#GL_ELEMENT_ARRAY_BUFFER}
+ *
+ * @param name The custom name for the GL attribute, maybe null if gpuBufferTarget is {@link GL#GL_ELEMENT_ARRAY_BUFFER}
* @param comps The array component number
* @param dataType The array index GL data type
* @param normalized Whether the data shall be normalized
@@ -90,7 +90,7 @@ public class GLArrayDataWrapper implements GLArrayData {
* @return the new create instance
* @throws GLException
*/
- public static GLArrayDataWrapper createGLSL(String name, int comps, int dataType, boolean normalized, int stride,
+ public static GLArrayDataWrapper createGLSL(String name, int comps, int dataType, boolean normalized, int stride,
Buffer buffer, int vboName, long vboOffset, int vboUsage, int vboTarget)
throws GLException
{
@@ -102,8 +102,8 @@ public class GLArrayDataWrapper implements GLArrayData {
/**
* Validates this instance's parameter. Called automatically by {@link GLArrayDataClient} and {@link GLArrayDataServer}.
- * {@link GLArrayDataWrapper} does not validate it's instance by itself.
- *
+ * {@link GLArrayDataWrapper} does not validate it's instance by itself.
+ *
* @param glp the GLProfile to use
* @param throwException whether to throw an exception if this instance has invalid parameter or not
* @return true if this instance has invalid parameter, otherwise false
@@ -113,7 +113,7 @@ public class GLArrayDataWrapper implements GLArrayData {
if(throwException) {
throw new GLException("Instance !alive "+this);
}
- return false;
+ return false;
}
if(this.isVertexAttribute() && !glp.hasGLSL()) {
if(throwException) {
@@ -123,13 +123,13 @@ public class GLArrayDataWrapper implements GLArrayData {
}
return glp.isValidArrayDataType(getIndex(), getComponentCount(), getComponentType(), isVertexAttribute(), throwException);
}
-
+
@Override
public void associate(Object obj, boolean enable) {
// nop
}
-
- //
+
+ //
// Data read access
//
@@ -150,14 +150,14 @@ public class GLArrayDataWrapper implements GLArrayData {
location = gl.glGetAttribLocation(program, name);
return location;
}
-
+
@Override
public final int setLocation(GL2ES2 gl, int program, int location) {
this.location = location;
gl.glBindAttribLocation(program, location, name);
return location;
}
-
+
@Override
public final String getName() { return name; }
@@ -172,10 +172,10 @@ public class GLArrayDataWrapper implements GLArrayData {
@Override
public final int getVBOUsage() { return vboEnabled?vboUsage:0; }
-
+
@Override
public final int getVBOTarget() { return vboEnabled?vboTarget:0; }
-
+
@Override
public final Buffer getBuffer() { return buffer; }
@@ -187,19 +187,19 @@ public class GLArrayDataWrapper implements GLArrayData {
@Override
public final int getComponentSizeInBytes() { return componentByteSize; }
-
+
@Override
public final int getElementCount() {
if(null==buffer) return 0;
return ( buffer.position()==0 ) ? ( buffer.limit() / components ) : ( buffer.position() / components ) ;
}
-
+
@Override
public final int getSizeInBytes() {
if(null==buffer) return 0;
- return ( buffer.position()==0 ) ? ( buffer.limit() * componentByteSize ) : ( buffer.position() * componentByteSize ) ;
+ return ( buffer.position()==0 ) ? ( buffer.limit() * componentByteSize ) : ( buffer.position() * componentByteSize ) ;
}
-
+
@Override
public final boolean getNormalized() { return normalized; }
@@ -223,18 +223,18 @@ public class GLArrayDataWrapper implements GLArrayData {
", index "+index+
", location "+location+
", isVertexAttribute "+isVertexAttribute+
- ", dataType 0x"+Integer.toHexString(componentType)+
- ", bufferClazz "+componentClazz+
+ ", dataType 0x"+Integer.toHexString(componentType)+
+ ", bufferClazz "+componentClazz+
", elements "+getElementCount()+
- ", components "+components+
+ ", components "+components+
", stride "+strideB+"b "+strideL+"c"+
- ", buffer "+buffer+
- ", vboEnabled "+vboEnabled+
- ", vboName "+vboName+
- ", vboUsage 0x"+Integer.toHexString(vboUsage)+
- ", vboTarget 0x"+Integer.toHexString(vboTarget)+
- ", vboOffset "+vboOffset+
- ", alive "+alive+
+ ", buffer "+buffer+
+ ", vboEnabled "+vboEnabled+
+ ", vboName "+vboName+
+ ", vboUsage 0x"+Integer.toHexString(vboUsage)+
+ ", vboTarget 0x"+Integer.toHexString(vboTarget)+
+ ", vboOffset "+vboOffset+
+ ", alive "+alive+
"]";
}
@@ -252,12 +252,12 @@ public class GLArrayDataWrapper implements GLArrayData {
return IntBuffer.class;
case GL.GL_FLOAT:
return FloatBuffer.class;
- default:
+ default:
throw new GLException("Given OpenGL data type not supported: "+dataType);
}
}
- @Override
+ @Override
public void setName(String newName) {
location = -1;
name = newName;
@@ -267,7 +267,7 @@ public class GLArrayDataWrapper implements GLArrayData {
* Enable or disable use of VBO.
* Only possible if a VBO buffer name is defined.
* @see #setVBOName(int)
- */
+ */
public void setVBOEnabled(boolean vboEnabled) {
this.vboEnabled=vboEnabled;
}
@@ -275,31 +275,31 @@ public class GLArrayDataWrapper implements GLArrayData {
/**
* Set the VBO buffer name, if valid (!= 0) enable use of VBO,
* otherwise (==0) disable VBO usage.
- *
+ *
* @see #setVBOEnabled(boolean)
- */
+ */
public void setVBOName(int vboName) {
this.vboName=vboName;
setVBOEnabled(0!=vboName);
}
- /**
+ /**
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
- */
- public void setVBOUsage(int vboUsage) {
- this.vboUsage = vboUsage;
+ */
+ public void setVBOUsage(int vboUsage) {
+ this.vboUsage = vboUsage;
}
-
- /**
+
+ /**
* @param vboTarget either {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
- */
+ */
public void setVBOTarget(int vboTarget) {
this.vboTarget = vboTarget;
- }
+ }
- protected void init(String name, int index, int components, int componentType,
- boolean normalized, int stride, Buffer data,
- boolean isVertexAttribute,
+ protected void init(String name, int index, int components, int componentType,
+ boolean normalized, int stride, Buffer data,
+ boolean isVertexAttribute,
int vboName, long vboOffset, int vboUsage, int vboTarget)
throws GLException
{
@@ -307,19 +307,19 @@ public class GLArrayDataWrapper implements GLArrayData {
this.index = index;
this.location = -1;
// We can't have any dependence on the FixedFuncUtil class here for build bootstrapping reasons
-
+
if( GL.GL_ELEMENT_ARRAY_BUFFER == vboTarget ) {
// OK ..
} else if( ( 0 == vboUsage && 0 == vboTarget ) || GL.GL_ARRAY_BUFFER == vboTarget ) {
- // Set/Check name .. - Required for GLSL case. Validation and debug-name for FFP.
+ // Set/Check name .. - Required for GLSL case. Validation and debug-name for FFP.
this.name = ( null == name ) ? GLPointerFuncUtil.getPredefinedArrayIndexName(index) : name ;
if(null == this.name ) {
throw new GLException("Not a valid array buffer index: "+index);
- }
+ }
} else if( 0 < vboTarget ) {
throw new GLException("Invalid GPUBuffer target: 0x"+Integer.toHexString(vboTarget));
}
-
+
this.componentType = componentType;
componentClazz = getBufferClass(componentType);
if( GLBuffers.isGLTypeFixedPoint(componentType) ) {
@@ -329,7 +329,7 @@ public class GLArrayDataWrapper implements GLArrayData {
}
componentByteSize = GLBuffers.sizeOfGLType(componentType);
if(0 > componentByteSize) {
- throw new GLException("Given componentType not supported: "+componentType+":\n\t"+this);
+ throw new GLException("Given componentType not supported: "+componentType+":\n\t"+this);
}
if(0 >= components) {
throw new GLException("Invalid number of components: " + components);
@@ -348,7 +348,7 @@ public class GLArrayDataWrapper implements GLArrayData {
this.vboName= vboName;
this.vboEnabled= 0 != vboName ;
this.vboOffset=vboOffset;
-
+
switch(vboUsage) {
case 0: // nop
case GL.GL_STATIC_DRAW:
@@ -356,7 +356,7 @@ public class GLArrayDataWrapper implements GLArrayData {
case GL2ES2.GL_STREAM_DRAW:
break;
default:
- throw new GLException("invalid gpuBufferUsage: "+vboUsage+":\n\t"+this);
+ throw new GLException("invalid gpuBufferUsage: "+vboUsage+":\n\t"+this);
}
switch(vboTarget) {
case 0: // nop
@@ -367,7 +367,7 @@ public class GLArrayDataWrapper implements GLArrayData {
throw new GLException("invalid gpuBufferTarget: "+vboTarget+":\n\t"+this);
}
this.vboUsage=vboUsage;
- this.vboTarget=vboTarget;
+ this.vboTarget=vboTarget;
this.alive=true;
}
@@ -390,6 +390,6 @@ public class GLArrayDataWrapper implements GLArrayData {
protected int vboName;
protected boolean vboEnabled;
protected int vboUsage;
- protected int vboTarget;
+ protected int vboTarget;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
index 6bdea4518..418d7fa81 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2008 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.
*/
@@ -52,7 +52,7 @@ import com.jogamp.common.nio.Buffers;
/**
* Utility routines for dealing with direct buffers.
- *
+ *
* @author Kenneth Russel, et.al.
*/
public class GLBuffers extends Buffers {
@@ -72,11 +72,11 @@ public class GLBuffers extends Buffers {
case GL.GL_UNSIGNED_INT:
case GL2.GL_HILO16_NV:
return false;
-
+
}
return true;
}
-
+
/**
* @param glType GL primitive type
* @return false if one of GL primitive floating point types, otherwise true
@@ -92,19 +92,19 @@ public class GLBuffers extends Buffers {
case GLES2.GL_HALF_FLOAT_OES:
case GL2GL3.GL_DOUBLE:
return false;
-
+
default:
return true;
- }
+ }
}
-
+
/**
* @param glType shall be one of (31)
* GL_BYTE, GL_UNSIGNED_BYTE,
* GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
*
* GL_SHORT, GL_UNSIGNED_SHORT,
- * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
+ * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
* GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
* GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
* GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
@@ -112,16 +112,16 @@ public class GLBuffers extends Buffers {
*
* GL_FIXED, GL_INT
* GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
- * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
+ * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
* GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
- * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
+ * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
* GL_HILO16_NV, GL_SIGNED_HILO16_NV
*
* GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV
*
- * GL_FLOAT, GL_DOUBLE
- *
- * @return -1 if glType is unhandled, otherwise the actual value > 0
+ * GL_FLOAT, GL_DOUBLE
+ *
+ * @return -1 if glType is unhandled, otherwise the actual value > 0
*/
public static final int sizeOfGLType(int glType) {
switch (glType) { // 29
@@ -131,7 +131,7 @@ public class GLBuffers extends Buffers {
case GL2GL3.GL_UNSIGNED_BYTE_3_3_2:
case GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV:
return SIZEOF_BYTE;
-
+
case GL.GL_SHORT:
case GL.GL_UNSIGNED_SHORT:
case GL.GL_UNSIGNED_SHORT_5_6_5:
@@ -145,40 +145,40 @@ public class GLBuffers extends Buffers {
case GL.GL_HALF_FLOAT:
case GLES2.GL_HALF_FLOAT_OES:
return SIZEOF_SHORT;
-
+
case GL.GL_FIXED:
case GL2ES2.GL_INT:
case GL.GL_UNSIGNED_INT:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
- case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
case GL2GL3.GL_UNSIGNED_INT_24_8:
case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
case GL2.GL_HILO16_NV:
case GL2.GL_SIGNED_HILO16_NV:
return SIZEOF_INT;
-
+
case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
return SIZEOF_LONG;
-
+
case GL.GL_FLOAT:
return SIZEOF_FLOAT;
-
+
case GL2GL3.GL_DOUBLE:
return SIZEOF_DOUBLE;
}
return -1;
}
-
+
/**
* @param glType shall be one of (31)
* GL_BYTE, GL_UNSIGNED_BYTE,
* GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
*
* GL_SHORT, GL_UNSIGNED_SHORT,
- * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
+ * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
* GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
* GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
* GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
@@ -186,16 +186,16 @@ public class GLBuffers extends Buffers {
*
* GL_FIXED, GL_INT
* GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
- * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
+ * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
* GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
- * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
+ * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
* GL_HILO16_NV, GL_SIGNED_HILO16_NV
*
* GL_FLOAT_32_UNSIGNED_INT_24_8_REV
*
- * GL_FLOAT, GL_DOUBLE
- *
- * @return null if glType is unhandled, otherwise the new Buffer object
+ * GL_FLOAT, GL_DOUBLE
+ *
+ * @return null if glType is unhandled, otherwise the new Buffer object
*/
public static final Buffer newDirectGLBuffer(int glType, int numElements) {
switch (glType) { // 29
@@ -204,7 +204,7 @@ public class GLBuffers extends Buffers {
case GL2GL3.GL_UNSIGNED_BYTE_3_3_2:
case GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV:
return newDirectByteBuffer(numElements);
-
+
case GL.GL_SHORT:
case GL.GL_UNSIGNED_SHORT:
case GL.GL_UNSIGNED_SHORT_5_6_5:
@@ -218,7 +218,7 @@ public class GLBuffers extends Buffers {
case GL.GL_HALF_FLOAT:
case GLES2.GL_HALF_FLOAT_OES:
return newDirectShortBuffer(numElements);
-
+
case GL.GL_FIXED:
case GL2ES2.GL_INT:
case GL.GL_UNSIGNED_INT:
@@ -232,13 +232,13 @@ public class GLBuffers extends Buffers {
case GL2.GL_HILO16_NV:
case GL2.GL_SIGNED_HILO16_NV:
return newDirectIntBuffer(numElements);
-
+
case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
return newDirectLongBuffer(numElements);
-
+
case GL.GL_FLOAT:
return newDirectFloatBuffer(numElements);
-
+
case GL2.GL_DOUBLE:
return newDirectDoubleBuffer(numElements);
}
@@ -251,7 +251,7 @@ public class GLBuffers extends Buffers {
* GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
*
* GL_SHORT, GL_UNSIGNED_SHORT,
- * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
+ * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
* GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
* GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
* GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
@@ -259,15 +259,15 @@ public class GLBuffers extends Buffers {
*
* GL_FIXED, GL_INT
* GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
- * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
+ * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
* GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
- * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
+ * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
* GL_HILO16_NV, GL_SIGNED_HILO16_NV
*
* GL_FLOAT_32_UNSIGNED_INT_24_8_REV
*
- * GL_FLOAT, GL_DOUBLE
- * @return null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object
+ * GL_FLOAT, GL_DOUBLE
+ * @return null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object
*/
public static final Buffer sliceGLBuffer(ByteBuffer parent, int bytePos, int byteLen, int glType) {
if (parent == null || byteLen == 0) {
@@ -275,11 +275,11 @@ public class GLBuffers extends Buffers {
}
final int parentPos = parent.position();
final int parentLimit = parent.limit();
-
+
parent.position(bytePos);
parent.limit(bytePos + byteLen);
Buffer res = null;
-
+
switch (glType) { // 29
case GL.GL_BYTE:
case GL.GL_UNSIGNED_BYTE:
@@ -287,7 +287,7 @@ public class GLBuffers extends Buffers {
case GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV:
res = parent.slice().order(parent.order()); // slice and duplicate may change byte order
break;
-
+
case GL.GL_SHORT:
case GL.GL_UNSIGNED_SHORT:
case GL.GL_UNSIGNED_SHORT_5_6_5:
@@ -302,7 +302,7 @@ public class GLBuffers extends Buffers {
case GLES2.GL_HALF_FLOAT_OES:
res = parent.slice().order(parent.order()).asShortBuffer(); // slice and duplicate may change byte order
break;
-
+
case GL.GL_FIXED:
case GL2GL3.GL_INT:
case GL2ES2.GL_UNSIGNED_INT:
@@ -317,15 +317,15 @@ public class GLBuffers extends Buffers {
case GL2.GL_SIGNED_HILO16_NV:
res = parent.slice().order(parent.order()).asIntBuffer(); // slice and duplicate may change byte order
break;
-
+
case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
res = parent.slice().order(parent.order()).asLongBuffer(); // slice and duplicate may change byte order
break;
-
+
case GL.GL_FLOAT:
res = parent.slice().order(parent.order()).asFloatBuffer(); // slice and duplicate may change byte order
break;
-
+
case GL2.GL_DOUBLE:
res = parent.slice().order(parent.order()).asDoubleBuffer(); // slice and duplicate may change byte order
break;
@@ -338,29 +338,29 @@ public class GLBuffers extends Buffers {
gl.glGetIntegerv(pname, tmp, 0);
return tmp[0];
}
-
- /**
+
+ /**
* Returns the number of bytes required to read/write a memory buffer via OpenGL
* using the current GL pixel storage state and the given parameters.
- *
+ *
*
This method is security critical, hence it throws an exception (fail-fast)
- * in case of an invalid alignment. In case we forgot to handle
- * proper values, please contact the maintainer.
- *
+ * in case of an invalid alignment. In case we forgot to handle
+ * proper values, please contact the maintainer.
+ *
* @param gl the current GL object
- *
+ *
* @param tmp a pass through integer array of size >= 1 used to store temp data (performance)
- *
+ *
* @param bytesPerPixel bytes per pixel, i.e. via {@link #bytesPerPixel(int, int)}.
* @param width in pixels
* @param height in pixels
* @param depth in pixels
- * @param pack true for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)
+ * @param pack true for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)
* @return required minimum size of the buffer in bytes
* @throws GLException if alignment is invalid. Please contact the maintainer if this is our bug.
*/
- public static final int sizeof(GL gl, int tmp[],
- int bytesPerPixel, int width, int height, int depth,
+ public static final int sizeof(GL gl, int tmp[],
+ int bytesPerPixel, int width, int height, int depth,
boolean pack) {
int rowLength = 0;
int skipRows = 0;
@@ -368,31 +368,31 @@ public class GLBuffers extends Buffers {
int alignment = 1;
int imageHeight = 0;
int skipImages = 0;
-
- if (pack) {
+
+ if (pack) {
alignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT, tmp);
if(gl.isGL2GL3()) {
rowLength = glGetInteger(gl, GL2GL3.GL_PACK_ROW_LENGTH, tmp);
- skipRows = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_ROWS, tmp);
+ skipRows = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_ROWS, tmp);
skipPixels = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_PIXELS, tmp);
- if (depth > 1) {
- imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp);
+ if (depth > 1) {
+ imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp);
skipImages = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_IMAGES, tmp);
}
}
- } else {
+ } else {
alignment = glGetInteger(gl, GL.GL_UNPACK_ALIGNMENT, tmp);
- if(gl.isGL2GL3 ()) {
- rowLength = glGetInteger(gl, GL2GL3.GL_UNPACK_ROW_LENGTH, tmp);
- skipRows = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_ROWS, tmp);
+ if(gl.isGL2GL3 ()) {
+ rowLength = glGetInteger(gl, GL2GL3.GL_UNPACK_ROW_LENGTH, tmp);
+ skipRows = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_ROWS, tmp);
skipPixels = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_PIXELS, tmp);
- if (depth > 1) {
- imageHeight = glGetInteger(gl, GL2GL3.GL_UNPACK_IMAGE_HEIGHT, tmp);
+ if (depth > 1) {
+ imageHeight = glGetInteger(gl, GL2GL3.GL_UNPACK_IMAGE_HEIGHT, tmp);
skipImages = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_IMAGES, tmp);
}
}
}
-
+
// Try to deal somewhat correctly with potentially invalid values
width = Math.max(0, width );
height = Math.max(1, height); // min 1D
@@ -401,13 +401,13 @@ public class GLBuffers extends Buffers {
skipPixels = Math.max(0, skipPixels);
alignment = Math.max(1, alignment);
skipImages = Math.max(0, skipImages);
-
+
imageHeight = ( imageHeight > 0 ) ? imageHeight : height;
rowLength = ( rowLength > 0 ) ? rowLength : width;
-
+
int rowLengthInBytes = rowLength * bytesPerPixel;
int skipBytes = skipPixels * bytesPerPixel;
-
+
switch(alignment) {
case 1:
break;
@@ -423,71 +423,71 @@ public class GLBuffers extends Buffers {
if (remainder > 0) {
skipBytes += alignment - remainder;
}
- }
+ }
break;
default:
- throw new GLException("Invalid alignment "+alignment+", must be 2**n (1,2,4,8). Pls notify the maintainer in case this is our bug.");
+ throw new GLException("Invalid alignment "+alignment+", must be 2**n (1,2,4,8). Pls notify the maintainer in case this is our bug.");
}
-
+
/**
* skipImages, depth, skipPixels and skipRows are static offsets.
*
* skipImages and depth are in multiples of image size.
*
* skipBytes and rowLengthInBytes are aligned
- *
- * rowLengthInBytes is the aligned byte offset
+ *
+ * rowLengthInBytes is the aligned byte offset
* from line n to line n+1 at the same x-axis position.
*/
return
skipBytes + // aligned skipPixels * bpp
- ( skipImages + depth - 1 ) * imageHeight * rowLengthInBytes + // aligned whole images
+ ( skipImages + depth - 1 ) * imageHeight * rowLengthInBytes + // aligned whole images
( skipRows + height - 1 ) * rowLengthInBytes + // aligned lines
- width * bytesPerPixel; // last line
+ width * bytesPerPixel; // last line
}
-
- /**
+
+ /**
* Returns the number of bytes required to read/write a memory buffer via OpenGL
* using the current GL pixel storage state and the given parameters.
- *
+ *
*
This method is security critical, hence it throws an exception (fail-fast)
- * in case either the format, type or alignment is unhandled. In case we forgot to handle
- * proper values, please contact the maintainer.
- *
+ * in case either the format, type or alignment is unhandled. In case we forgot to handle
+ * proper values, please contact the maintainer.
+ *
*
See {@link #bytesPerPixel(int, int)}.
- *
+ *
* @param gl the current GL object
- *
+ *
* @param tmp a pass through integer array of size >= 1 used to store temp data (performance)
- *
- * @param format must be one of (27)
- * GL_COLOR_INDEX GL_STENCIL_INDEX
- * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
- * GL_RED GL_RED_INTEGER
- * GL_GREEN GL_GREEN_INTEGER
- * GL_BLUE GL_BLUE_INTEGER
- * GL_ALPHA GL_LUMINANCE (12)
- *
+ *
+ * @param format must be one of (27)
+ * GL_COLOR_INDEX GL_STENCIL_INDEX
+ * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
+ * GL_RED GL_RED_INTEGER
+ * GL_GREEN GL_GREEN_INTEGER
+ * GL_BLUE GL_BLUE_INTEGER
+ * GL_ALPHA GL_LUMINANCE (12)
+ *
* GL_LUMINANCE_ALPHA GL_RG
- * GL_RG_INTEGER GL_HILO_NV
- * GL_SIGNED_HILO_NV (5)
- *
- * GL_YCBCR_422_APPLE
- *
- * GL_RGB GL_RGB_INTEGER
- * GL_BGR GL_BGR_INTEGER (4)
- *
- * GL_RGBA GL_RGBA_INTEGER
+ * GL_RG_INTEGER GL_HILO_NV
+ * GL_SIGNED_HILO_NV (5)
+ *
+ * GL_YCBCR_422_APPLE
+ *
+ * GL_RGB GL_RGB_INTEGER
+ * GL_BGR GL_BGR_INTEGER (4)
+ *
+ * GL_RGBA GL_RGBA_INTEGER
* GL_BGRA GL_BGRA_INTEGER
- * GL_ABGR_EXT (5)
- *
- * @param type must be one of (32)
- * GL_BITMAP,
+ * GL_ABGR_EXT (5)
+ *
+ * @param type must be one of (32)
+ * GL_BITMAP,
* GL_BYTE, GL_UNSIGNED_BYTE,
* GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
*
* GL_SHORT, GL_UNSIGNED_SHORT,
- * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
+ * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
* GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
* GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
* GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
@@ -495,70 +495,70 @@ public class GLBuffers extends Buffers {
*
* GL_FIXED, GL_INT
* GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
- * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
+ * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
* GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
- * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
+ * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
* GL_HILO16_NV, GL_SIGNED_HILO16_NV
*
* GL_FLOAT_32_UNSIGNED_INT_24_8_REV
*
- * GL_FLOAT, GL_DOUBLE
- *
+ * GL_FLOAT, GL_DOUBLE
+ *
* @param width in pixels
* @param height in pixels
* @param depth in pixels
- * @param pack true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
+ * @param pack true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
* @return required minimum size of the buffer in bytes
* @throws GLException if format, type or alignment is not handled. Please contact the maintainer if this is our bug.
*/
- public static final int sizeof(GL gl, int tmp[],
+ public static final int sizeof(GL gl, int tmp[],
int format, int type, int width, int height, int depth,
boolean pack) throws GLException {
if (width < 0) return 0;
if (height < 0) return 0;
if (depth < 0) return 0;
-
+
final int bytesPerPixel = bytesPerPixel(format, type);
return sizeof(gl, tmp, bytesPerPixel, width, height, depth, pack);
}
-
- /**
+
+ /**
* Returns the number of bytes required for one pixel with the the given OpenGL format and type.
- *
+ *
*
This method is security critical, hence it throws an exception (fail-fast)
- * in case either the format, type or alignment is unhandled. In case we forgot to handle
- * proper values, please contact the maintainer.
- *
+ * in case either the format, type or alignment is unhandled. In case we forgot to handle
+ * proper values, please contact the maintainer.
+ *
*
See {@link #componentCount(int)}.
- *
- * @param format must be one of (27)
- * GL_COLOR_INDEX GL_STENCIL_INDEX
- * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
- * GL_RED GL_RED_INTEGER
- * GL_GREEN GL_GREEN_INTEGER
- * GL_BLUE GL_BLUE_INTEGER
- * GL_ALPHA GL_LUMINANCE (12)
- *
+ *
+ * @param format must be one of (27)
+ * GL_COLOR_INDEX GL_STENCIL_INDEX
+ * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
+ * GL_RED GL_RED_INTEGER
+ * GL_GREEN GL_GREEN_INTEGER
+ * GL_BLUE GL_BLUE_INTEGER
+ * GL_ALPHA GL_LUMINANCE (12)
+ *
* GL_LUMINANCE_ALPHA GL_RG
- * GL_RG_INTEGER GL_HILO_NV
- * GL_SIGNED_HILO_NV (5)
- *
- * GL_YCBCR_422_APPLE
- *
- * GL_RGB GL_RGB_INTEGER
- * GL_BGR GL_BGR_INTEGER (4)
- *
- * GL_RGBA GL_RGBA_INTEGER
+ * GL_RG_INTEGER GL_HILO_NV
+ * GL_SIGNED_HILO_NV (5)
+ *
+ * GL_YCBCR_422_APPLE
+ *
+ * GL_RGB GL_RGB_INTEGER
+ * GL_BGR GL_BGR_INTEGER (4)
+ *
+ * GL_RGBA GL_RGBA_INTEGER
* GL_BGRA GL_BGRA_INTEGER
- * GL_ABGR_EXT (5)
- *
- * @param type must be one of (32)
- * GL_BITMAP,
+ * GL_ABGR_EXT (5)
+ *
+ * @param type must be one of (32)
+ * GL_BITMAP,
* GL_BYTE, GL_UNSIGNED_BYTE,
* GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
*
* GL_SHORT, GL_UNSIGNED_SHORT,
- * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
+ * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
* GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
* GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
* GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
@@ -566,15 +566,15 @@ public class GLBuffers extends Buffers {
*
* GL_FIXED, GL_INT
* GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
- * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
+ * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
* GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
- * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
+ * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
* GL_HILO16_NV, GL_SIGNED_HILO16_NV
*
* GL_FLOAT_32_UNSIGNED_INT_24_8_REV
*
- * GL_FLOAT, GL_DOUBLE
- *
+ * GL_FLOAT, GL_DOUBLE
+ *
* @return required size of one pixel in bytes
* @throws GLException if format or type alignment is not handled. Please contact the maintainer if this is our bug.
*/
@@ -582,14 +582,14 @@ public class GLBuffers extends Buffers {
int compSize = 0;
int compCount = componentCount(format);
-
+
switch (type) /* 30 */ {
case GL2.GL_BITMAP:
if (GL2.GL_COLOR_INDEX == format || GL2GL3.GL_STENCIL_INDEX == format) {
compSize = 1;
}
case GL.GL_BYTE:
- case GL.GL_UNSIGNED_BYTE:
+ case GL.GL_UNSIGNED_BYTE:
compSize = 1;
break;
case GL.GL_SHORT:
@@ -607,7 +607,7 @@ public class GLBuffers extends Buffers {
case GL2GL3.GL_DOUBLE:
compSize = 8;
break;
-
+
case GL2GL3.GL_UNSIGNED_BYTE_3_3_2:
case GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV:
compSize = 1;
@@ -630,7 +630,7 @@ public class GLBuffers extends Buffers {
case GL2.GL_SIGNED_HILO16_NV:
compSize = 2;
compCount = 2;
- break;
+ break;
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
@@ -640,52 +640,52 @@ public class GLBuffers extends Buffers {
case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
compSize = 4;
compCount = 1;
- break;
+ break;
case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
compSize = 8;
compCount = 1;
- break;
-
+ break;
+
default:
throw new GLException("type 0x"+Integer.toHexString(type)+"/"+"format 0x"+Integer.toHexString(format)+" not supported [yet], pls notify the maintainer in case this is our bug.");
- }
+ }
return compCount * compSize;
}
-
- /**
+
+ /**
* Returns the number of components required for the given OpenGL format.
- *
+ *
*
This method is security critical, hence it throws an exception (fail-fast)
- * in case either the format, type or alignment is unhandled. In case we forgot to handle
- * proper values, please contact the maintainer.
- *
- * @param format must be one of (27)
- * GL_COLOR_INDEX GL_STENCIL_INDEX
- * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
- * GL_RED GL_RED_INTEGER
- * GL_GREEN GL_GREEN_INTEGER
- * GL_BLUE GL_BLUE_INTEGER
- * GL_ALPHA GL_LUMINANCE (12)
- *
+ * in case either the format, type or alignment is unhandled. In case we forgot to handle
+ * proper values, please contact the maintainer.
+ *
+ * @param format must be one of (27)
+ * GL_COLOR_INDEX GL_STENCIL_INDEX
+ * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
+ * GL_RED GL_RED_INTEGER
+ * GL_GREEN GL_GREEN_INTEGER
+ * GL_BLUE GL_BLUE_INTEGER
+ * GL_ALPHA GL_LUMINANCE (12)
+ *
* GL_LUMINANCE_ALPHA GL_RG
- * GL_RG_INTEGER GL_HILO_NV
- * GL_SIGNED_HILO_NV (5)
- *
- * GL_YCBCR_422_APPLE
- *
- * GL_RGB GL_RGB_INTEGER
- * GL_BGR GL_BGR_INTEGER (4)
- *
- * GL_RGBA GL_RGBA_INTEGER
+ * GL_RG_INTEGER GL_HILO_NV
+ * GL_SIGNED_HILO_NV (5)
+ *
+ * GL_YCBCR_422_APPLE
+ *
+ * GL_RGB GL_RGB_INTEGER
+ * GL_BGR GL_BGR_INTEGER (4)
+ *
+ * GL_RGBA GL_RGBA_INTEGER
* GL_BGRA GL_BGRA_INTEGER
- * GL_ABGR_EXT (5)
- *
+ * GL_ABGR_EXT (5)
+ *
* @return number of components required for the given OpenGL format
* @throws GLException if format is not handled. Please contact the maintainer if this is our bug.
*/
public static final int componentCount(int format) throws GLException {
final int compCount;
-
+
switch (format) /* 26 */ {
case GL2.GL_COLOR_INDEX:
case GL2GL3.GL_STENCIL_INDEX:
@@ -711,10 +711,10 @@ public class GLBuffers extends Buffers {
case GL.GL_RGB:
case GL2GL3.GL_RGB_INTEGER:
case GL2GL3.GL_BGR:
- case GL2GL3.GL_BGR_INTEGER:
+ case GL2GL3.GL_BGR_INTEGER:
compCount = 3;
break;
- case GL2.GL_YCBCR_422_APPLE:
+ case GL2.GL_YCBCR_422_APPLE:
compCount = 3;
break;
case GL.GL_RGBA:
@@ -724,16 +724,16 @@ public class GLBuffers extends Buffers {
case GL2.GL_ABGR_EXT:
compCount = 4;
break;
- /* FIXME ??
+ /* FIXME ??
case GL.GL_HILO_NV:
elements = 2;
- break; */
+ break; */
default:
throw new GLException("format 0x"+Integer.toHexString(format)+" not supported [yet], pls notify the maintainer in case this is our bug.");
}
return compCount;
}
-
+
public static final int getNextPowerOf2(int number) {
if (((number-1) & number) == 0) {
//ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0
@@ -745,8 +745,8 @@ public class GLBuffers extends Buffers {
power++;
}
return (1<src to dest.
* If preserveInitState is true, it's initialized state is preserved
@@ -86,7 +86,7 @@ public class GLDrawableUtil {
dest.invoke(false, new GLEventListenerState.ReshapeGLEventListener(listener));
} // else .. !init state is default
}
-
+
/**
* Moves all {@link GLEventListener} from {@link GLAutoDrawable} src to dest.
* If preserveInitState is true, it's initialized state is preserved
@@ -113,12 +113,12 @@ public class GLDrawableUtil {
/**
* Swaps the {@link GLContext} and all {@link GLEventListener} between {@link GLAutoDrawable} a and b,
* while preserving it's initialized state, resets the GL-Viewport and issuing {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)}.
- *
- * The {@link GLAutoDrawable} to {@link GLAnimatorControl} association
- * is also swapped.
+ *
+ * The {@link GLAutoDrawable} to {@link GLAnimatorControl} association
+ * is also swapped.
*
*
- * If an {@link GLAnimatorControl} is being attached to {@link GLAutoDrawable} a or b
+ * If an {@link GLAnimatorControl} is being attached to {@link GLAutoDrawable} a or b
* and the current thread is different than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
*
* @param a
@@ -128,31 +128,31 @@ public class GLDrawableUtil {
public static final void swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b) {
final GLEventListenerState gllsA = GLEventListenerState.moveFrom(a);
final GLEventListenerState gllsB = GLEventListenerState.moveFrom(b);
-
+
gllsA.moveTo(b);
gllsB.moveTo(a);
}
-
- /**
- * Swaps the {@link GLContext} of given {@link GLAutoDrawable}
- * and {@link GLAutoDrawable#disposeGLEventListener(GLEventListener, boolean) disposes}
+
+ /**
+ * Swaps the {@link GLContext} of given {@link GLAutoDrawable}
+ * and {@link GLAutoDrawable#disposeGLEventListener(GLEventListener, boolean) disposes}
* each {@link GLEventListener} w/o removing it.
*
* The GL-Viewport is reset and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued implicit.
- *
+ *
*
- * If an {@link GLAnimatorControl} is being attached to GLAutoDrawable src or dest and the current thread is different
+ * If an {@link GLAnimatorControl} is being attached to GLAutoDrawable src or dest and the current thread is different
* than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
*
* @param src
* @param dest
*/
- public static final void swapGLContext(GLAutoDrawable src, GLAutoDrawable dest) {
+ public static final void swapGLContext(GLAutoDrawable src, GLAutoDrawable dest) {
final GLAnimatorControl aAnim = src.getAnimator();
- final GLAnimatorControl bAnim = dest.getAnimator();
+ final GLAnimatorControl bAnim = dest.getAnimator();
final boolean aIsPaused = isAnimatorAnimatingOnOtherThread(aAnim) && aAnim.pause();
final boolean bIsPaused = isAnimatorAnimatingOnOtherThread(bAnim) && bAnim.pause();
-
+
for(int i = src.getGLEventListenerCount() - 1; 0 <= i; i--) {
src.disposeGLEventListener(src.getGLEventListener(i), false);
}
@@ -160,12 +160,12 @@ public class GLDrawableUtil {
dest.disposeGLEventListener(dest.getGLEventListener(i), false);
}
dest.setContext( src.setContext( dest.getContext(), false ), false );
-
+
src.invoke(true, GLEventListenerState.setViewport);
dest.invoke(true, GLEventListenerState.setViewport);
-
+
if(aIsPaused) { aAnim.resume(); }
if(bIsPaused) { bAnim.resume(); }
}
-
+
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
index 71e284101..f0c6be44f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.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.
@@ -39,78 +39,78 @@ import javax.media.opengl.GLException;
import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.util.texture.TextureData;
-/**
+/**
* OpenGL pixel data buffer, allowing user to provide buffers via their {@link GLPixelBufferProvider} implementation.
*
* {@link GLPixelBufferProvider} produces a {@link GLPixelBuffer}.
- *
+ *
*
* You may use {@link #defaultProviderNoRowStride}.
*
*/
public class GLPixelBuffer {
-
- /** Allows user to interface with another toolkit to define {@link GLPixelAttributes} and memory buffer to produce {@link TextureData}. */
+
+ /** Allows user to interface with another toolkit to define {@link GLPixelAttributes} and memory buffer to produce {@link TextureData}. */
public static interface GLPixelBufferProvider {
/** Allow {@link GL2ES3#GL_PACK_ROW_LENGTH}, or {@link GL2ES2#GL_UNPACK_ROW_LENGTH}. */
boolean getAllowRowStride();
-
+
/** Called first to determine {@link GLPixelAttributes}. */
GLPixelAttributes getAttributes(GL gl, int componentCount);
-
- /**
+
+ /**
* Allocates a new {@link GLPixelBuffer} object.
*
* Being called to gather the initial {@link GLPixelBuffer},
* or a new replacement {@link GLPixelBuffer} if {@link GLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
*
*
- * The minimum required {@link Buffer#remaining() remaining} byte size equals to minByteSize, if > 0,
+ * The minimum required {@link Buffer#remaining() remaining} byte size equals to minByteSize, if > 0,
* otherwise utilize {@link GLBuffers#sizeof(GL, int[], int, int, int, int, int, boolean)}
* to calculate it.
*
- *
+ *
* @param gl the corresponding current GL context object
* @param pixelAttributes the desired {@link GLPixelAttributes}
* @param width in pixels
* @param height in pixels
* @param depth in pixels
* @param pack true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
- * @param minByteSize if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
+ * @param minByteSize if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
*/
GLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize);
}
- /** Single {@link GLPixelBuffer} provider. */
+ /** Single {@link GLPixelBuffer} provider. */
public static interface SingletonGLPixelBufferProvider extends GLPixelBufferProvider {
- /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link GLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
+ /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link GLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
GLPixelBuffer getSingleBuffer(GLPixelAttributes pixelAttributes);
- /**
+ /**
* Initializes the single {@link GLPixelBuffer} w/ a given size, if not yet {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated}.
* @return the newly initialized single {@link GLPixelBuffer}, or null if already allocated.
*/
- GLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack);
+ GLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack);
}
public static class DefaultGLPixelBufferProvider implements GLPixelBufferProvider {
private final boolean allowRowStride;
-
+
/**
- * @param allowRowStride If true, allow row-stride, otherwise not.
+ * @param allowRowStride If true, allow row-stride, otherwise not.
* See {@link #getAllowRowStride()} and {@link GLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
*/
public DefaultGLPixelBufferProvider(boolean allowRowStride) {
- this.allowRowStride = allowRowStride;
+ this.allowRowStride = allowRowStride;
}
-
+
@Override
public boolean getAllowRowStride() { return allowRowStride; }
-
+
@Override
public GLPixelAttributes getAttributes(GL gl, int componentCount) {
final GLContext ctx = gl.getContext();
final int dFormat, dType;
-
+
if( 1 == componentCount ) {
if( gl.isGL3ES3() ) {
// RED is supported on ES3 and >= GL3 [core]; ALPHA is deprecated on core
@@ -122,7 +122,7 @@ public class GLPixelBuffer {
dType = GL.GL_UNSIGNED_BYTE;
} else if( 3 == componentCount ) {
dFormat = GL.GL_RGB;
- dType = GL.GL_UNSIGNED_BYTE;
+ dType = GL.GL_UNSIGNED_BYTE;
} else if( 4 == componentCount ) {
int _dFormat = ctx.getDefaultPixelDataFormat();
final int dComps = GLBuffers.componentCount(_dFormat);
@@ -131,14 +131,14 @@ public class GLPixelBuffer {
dType = ctx.getDefaultPixelDataType();
} else {
dFormat = GL.GL_RGBA;
- dType = GL.GL_UNSIGNED_BYTE;
+ dType = GL.GL_UNSIGNED_BYTE;
}
} else {
throw new GLException("Unsupported componentCount "+componentCount+", contact maintainer to enhance");
}
return new GLPixelAttributes(componentCount, dFormat, dType);
}
-
+
/**
* {@inheritDoc}
*
@@ -148,7 +148,7 @@ public class GLPixelBuffer {
@Override
public GLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
if( minByteSize > 0 ) {
- return new GLPixelBuffer(pixelAttributes, width, height, depth, pack, Buffers.newDirectByteBuffer(minByteSize), getAllowRowStride());
+ return new GLPixelBuffer(pixelAttributes, width, height, depth, pack, Buffers.newDirectByteBuffer(minByteSize), getAllowRowStride());
} else {
int[] tmp = { 0 };
final int byteSize = GLBuffers.sizeof(gl, tmp, pixelAttributes.bytesPerPixel, width, height, depth, pack);
@@ -156,26 +156,26 @@ public class GLPixelBuffer {
}
}
}
-
- /**
+
+ /**
* Default {@link GLPixelBufferProvider} with {@link GLPixelBufferProvider#getAllowRowStride()} == false,
* utilizing best match for {@link GLPixelAttributes}
* and {@link GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocating} a {@link ByteBuffer}.
*/
public static GLPixelBufferProvider defaultProviderNoRowStride = new DefaultGLPixelBufferProvider(false);
-
- /**
+
+ /**
* Default {@link GLPixelBufferProvider} with {@link GLPixelBufferProvider#getAllowRowStride()} == true,
* utilizing best match for {@link GLPixelAttributes}
* and {@link GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocating} a {@link ByteBuffer}.
*/
public static GLPixelBufferProvider defaultProviderWithRowStride = new DefaultGLPixelBufferProvider(true);
-
- /** Pixel attributes. */
+
+ /** Pixel attributes. */
public static class GLPixelAttributes {
- /** Undefined instance of {@link GLPixelAttributes}, having componentCount:=0, format:=0 and type:= 0. */
+ /** Undefined instance of {@link GLPixelAttributes}, having componentCount:=0, format:=0 and type:= 0. */
public static final GLPixelAttributes UNDEF = new GLPixelAttributes(0, 0, 0, false);
-
+
/** Pixel source component count, i.e. number of meaningful components. */
public final int componentCount;
/** The OpenGL pixel data format */
@@ -184,7 +184,7 @@ public class GLPixelBuffer {
public final int type;
/** The OpenGL pixel size in bytes */
public final int bytesPerPixel;
-
+
/**
* Deriving {@link #componentCount} via GL dataFormat, i.e. {@link GLBuffers#componentCount(int)} if > 0.
* @param dataFormat GL data format
@@ -194,7 +194,7 @@ public class GLPixelBuffer {
this(0 < dataFormat ? GLBuffers.componentCount(dataFormat) : 0, dataFormat, dataType);
}
/**
- * Using user specified source {@link #componentCount}.
+ * Using user specified source {@link #componentCount}.
* @param componentCount source component count
* @param dataFormat GL data format
* @param dataType GL data type
@@ -220,7 +220,7 @@ public class GLPixelBuffer {
return "PixelAttributes[comp "+componentCount+", fmt 0x"+Integer.toHexString(format)+", type 0x"+Integer.toHexString(type)+", bytesPerPixel "+bytesPerPixel+"]";
}
}
-
+
/** The {@link GLPixelAttributes}. */
public final GLPixelAttributes pixelAttributes;
/** Width in pixels. */
@@ -233,22 +233,22 @@ public class GLPixelBuffer {
public final boolean pack;
/** Byte size of the buffer. Actually the number of {@link Buffer#remaining()} bytes when passed in ctor. */
public final int byteSize;
- /**
- * Buffer holding the pixel data. If {@link #rewind()}, it holds byteSize {@link Buffer#remaining()} bytes.
+ /**
+ * Buffer holding the pixel data. If {@link #rewind()}, it holds byteSize {@link Buffer#remaining()} bytes.
*
* By default the {@link Buffer} is a {@link ByteBuffer}, due to {@link DefProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int)}.
* However, other {@link GLPixelBufferProvider} may utilize different {@link Buffer} types.
*
- */
+ */
public final Buffer buffer;
/** Buffer element size in bytes. */
public final int bufferElemSize;
-
+
/** Allow {@link GL2ES3#GL_PACK_ROW_LENGTH}, or {@link GL2ES2#GL_UNPACK_ROW_LENGTH}. See {@link #requiresNewBuffer(GL, int, int, int)}. */
public final boolean allowRowStride;
-
+
private boolean disposed = false;
-
+
public StringBuilder toString(StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
@@ -272,7 +272,7 @@ public class GLPixelBuffer {
* @param allowRowStride If true, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
*/
public GLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, Buffer buffer, boolean allowRowStride) {
- this.pixelAttributes = pixelAttributes;
+ this.pixelAttributes = pixelAttributes;
this.width = width;
this.height = height;
this.depth = depth;
@@ -282,15 +282,15 @@ public class GLPixelBuffer {
this.bufferElemSize = Buffers.sizeOfBufferElem(buffer);
this.allowRowStride = allowRowStride;
}
-
+
/** Allow {@link GL2ES3#GL_PACK_ROW_LENGTH}, or {@link GL2ES2#GL_UNPACK_ROW_LENGTH}. */
public final boolean getAllowRowStride() { return allowRowStride; }
-
+
/** Is not {@link #dispose() disposed} and has {@link #byteSize} > 0. */
public boolean isValid() {
return !disposed && 0 < byteSize;
}
-
+
/** See {@link Buffer#rewind()}. */
public Buffer rewind() {
return buffer.rewind();
@@ -300,40 +300,40 @@ public class GLPixelBuffer {
public int position() {
return buffer.position() * bufferElemSize;
}
-
+
/** Sets the byte position of the {@link #buffer}. */
public Buffer position(int bytePos) {
return buffer.position( bytePos / bufferElemSize );
}
-
+
/** Returns the byte capacity of the {@link #buffer}. */
public int capacity() {
return buffer.capacity() * bufferElemSize;
}
-
+
/** Returns the byte limit of the {@link #buffer}. */
public int limit() {
return buffer.limit() * bufferElemSize;
}
-
+
/** See {@link Buffer#flip()}. */
public Buffer flip() {
- return buffer.flip();
+ return buffer.flip();
}
-
+
/** See {@link Buffer#clear()}. */
public Buffer clear() {
- return buffer.clear();
+ return buffer.clear();
}
-
- /**
+
+ /**
* Returns true, if {@link #isValid() invalid} or implementation requires a new buffer based on the new size
* due to pixel alignment or byte size, otherwise false.
*
* It is assumed that pixelAttributes, depth and pack stays the same!
*
*
- * The minimum required byte size equals to minByteSize, if > 0,
+ * The minimum required byte size equals to minByteSize, if > 0,
* otherwise {@link GLBuffers#sizeof(GL, int[], int, int, int, int, int, boolean) GLBuffers.sizeof(..)}
* is being used to calculate it. This value is referred to newByteSize.
*
@@ -341,16 +341,16 @@ public class GLPixelBuffer {
* If {@link #allowRowStride} = false,
* method returns true if the newByteSize > currentByteSize
* or the newWidth != currentWidth.
- *
+ *
*
* If {@link #allowRowStride} = true, see {@link GLPixelBufferProvider#getAllowRowStride()},
- * method returns true only if the newByteSize > currentByteSize.
+ * method returns true only if the newByteSize > currentByteSize.
* Assuming user utilizes the row-stride when dealing w/ the data, i.e. {@link GL2ES3#GL_PACK_ROW_LENGTH}.
*
* @param gl the corresponding current GL context object
* @param newWidth new width in pixels
* @param newHeight new height in pixels
- * @param newByteSize if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
+ * @param newByteSize if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
* @see GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int)
*/
public boolean requiresNewBuffer(GL gl, int newWidth, int newHeight, int newByteSize) {
@@ -366,7 +366,7 @@ public class GLPixelBuffer {
}
return byteSize < newByteSize || width != newWidth;
}
-
+
/** Dispose resources. See {@link #isValid()}. */
public void dispose() {
disposed = true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
index f512a3aae..1c6e97450 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
@@ -46,35 +46,35 @@ public class GLPixelStorageModes {
/** Create instance w/o {@link #save(GL)} */
public GLPixelStorageModes() {}
-
+
/** Create instance w/ {@link #save(GL)} */
public GLPixelStorageModes(GL gl) { save(gl); }
-
+
/**
* Sets the {@link GL#GL_PACK_ALIGNMENT}.
- *
+ *
* Saves the pixel storage modes if not saved yet.
*
*/
public final void setPackAlignment(GL gl, int packAlignment) {
save(gl);
- gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
+ gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
}
/**
* Sets the {@link GL#GL_UNPACK_ALIGNMENT}.
- *
+ *
* Saves the pixel storage modes if not saved yet.
*
*/
public final void setUnpackAlignment(GL gl, int unpackAlignment) {
save(gl);
- gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, unpackAlignment);
+ gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, unpackAlignment);
}
-
+
/**
- * Sets the {@link GL#GL_PACK_ALIGNMENT} and {@link GL#GL_UNPACK_ALIGNMENT}.
- *
+ * Sets the {@link GL#GL_PACK_ALIGNMENT} and {@link GL#GL_UNPACK_ALIGNMENT}.
+ *
* Saves the pixel storage modes if not saved yet.
*
*/
@@ -82,32 +82,32 @@ public class GLPixelStorageModes {
setPackAlignment(gl, packAlignment);
setUnpackAlignment(gl, unpackAlignment);
}
-
+
/**
* Sets the {@link GL2ES3#GL_PACK_ROW_LENGTH}.
- *
+ *
* Saves the pixel storage modes if not saved yet.
*
*/
public final void setPackRowLength(GL2ES3 gl, int packRowLength) {
save(gl);
- gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, packRowLength);
+ gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, packRowLength);
}
/**
* Sets the {@link GL2ES2#GL_UNPACK_ROW_LENGTH}.
- *
+ *
* Saves the pixel storage modes if not saved yet.
*
*/
public final void setUnpackRowLength(GL2ES2 gl, int unpackRowLength) {
save(gl);
- gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, unpackRowLength);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, unpackRowLength);
}
-
+
/**
* Sets the {@link GL2ES3#GL_PACK_ROW_LENGTH} and {@link GL2ES2#GL_UNPACK_ROW_LENGTH}.
- *
+ *
* Saves the pixel storage modes if not saved yet.
*
*/
@@ -115,7 +115,7 @@ public class GLPixelStorageModes {
setPackRowLength(gl, packRowLength);
setUnpackRowLength(gl, unpackRowLength);
}
-
+
/**
* Save the pixel storage mode, if not saved yet.
*
@@ -126,8 +126,8 @@ public class GLPixelStorageModes {
if(saved) {
return;
}
-
- if(gl.isGL2GL3()) {
+
+ if(gl.isGL2GL3()) {
if(gl.isGL2()) {
gl.getGL2().glPushClientAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT);
} else {
@@ -154,7 +154,7 @@ public class GLPixelStorageModes {
// embedded deals with pack/unpack alignment only
gl.glGetIntegerv(GL2ES2.GL_PACK_ALIGNMENT, savedAlignment, 0);
gl.glGetIntegerv(GL2ES2.GL_UNPACK_ALIGNMENT, savedAlignment, 1);
- }
+ }
saved = true;
}
@@ -166,8 +166,8 @@ public class GLPixelStorageModes {
if(!saved) {
throw new GLException("pixel storage modes not saved");
}
-
- if(gl.isGL2GL3()) {
+
+ if(gl.isGL2GL3()) {
if(gl.isGL2()) {
gl.getGL2().glPopClientAttrib();
} else {
@@ -186,9 +186,9 @@ public class GLPixelStorageModes {
// embedded deals with pack/unpack alignment only
gl.glPixelStorei(GL2ES2.GL_PACK_ALIGNMENT, savedAlignment[0]);
gl.glPixelStorei(GL2ES2.GL_UNPACK_ALIGNMENT, savedAlignment[1]);
- }
+ }
saved = false;
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
index 65d1b6906..b942c9ab2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.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 com.jogamp.opengl.util;
import java.io.File;
@@ -51,45 +51,45 @@ import com.jogamp.opengl.util.texture.TextureIO;
*/
public class GLReadBufferUtil {
protected final GLPixelBufferProvider pixelBufferProvider;
- protected final int componentCount, alignment;
+ protected final int componentCount, alignment;
protected final Texture readTexture;
- protected final GLPixelStorageModes psm;
-
+ protected final GLPixelStorageModes psm;
+
protected GLPixelBuffer readPixelBuffer = null;
protected TextureData readTextureData = null;
/**
- * @param alpha true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: Alpha maybe forced on ES platforms!
+ * @param alpha true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: Alpha maybe forced on ES platforms!
* @param write2Texture true if readPixel's TextureData shall be written to a 2d Texture
*/
public GLReadBufferUtil(boolean alpha, boolean write2Texture) {
this(GLPixelBuffer.defaultProviderNoRowStride, alpha, write2Texture);
}
-
+
public GLReadBufferUtil(GLPixelBufferProvider pixelBufferProvider, boolean alpha, boolean write2Texture) {
this.pixelBufferProvider = pixelBufferProvider;
this.componentCount = alpha ? 4 : 3 ;
- this.alignment = alpha ? 4 : 1 ;
+ this.alignment = alpha ? 4 : 1 ;
this.readTexture = write2Texture ? new Texture(GL.GL_TEXTURE_2D) : null ;
this.psm = new GLPixelStorageModes();
}
-
+
/** Returns the {@link GLPixelBufferProvider} used by this instance. */
public GLPixelBufferProvider getPixelBufferProvider() { return pixelBufferProvider; }
-
+
public boolean isValid() {
return null!=readTextureData && null!=readPixelBuffer && readPixelBuffer.isValid();
}
-
+
public boolean hasAlpha() { return 4 == componentCount ? true : false ; }
-
+
public GLPixelStorageModes getGLPixelStorageModes() { return psm; }
-
+
/**
* Returns the {@link GLPixelBuffer}, created and filled by {@link #readPixels(GLAutoDrawable, boolean)}.
*/
public GLPixelBuffer getPixelBuffer() { return readPixelBuffer; }
-
+
/**
* rewind the raw pixel ByteBuffer
*/
@@ -99,7 +99,7 @@ public class GLReadBufferUtil {
* @return the resulting TextureData, filled by {@link #readPixels(GLAutoDrawable, boolean)}
*/
public TextureData getTextureData() { return readTextureData; }
-
+
/**
* @return the Texture object filled by {@link #readPixels(GLAutoDrawable, boolean)},
* if this instance writes to a 2d Texture, otherwise null.
@@ -121,27 +121,27 @@ public class GLReadBufferUtil {
/**
* Read the drawable's pixels to TextureData and Texture, if requested at construction.
- *
+ *
* @param gl the current GL context object. It's read drawable is being used as the pixel source.
* @param mustFlipVertically indicates whether to flip the data vertically or not.
* The context's drawable {@link GLDrawable#isGLOriented()} state
* is taken into account.
* Vertical flipping is propagated to TextureData
* and handled in a efficient manner there (TextureCoordinates and TextureIO writer).
- *
+ *
* @see #GLReadBufferUtil(boolean, boolean)
*/
public boolean readPixels(GL gl, boolean mustFlipVertically) {
return readPixels(gl, 0, 0, 0, 0, mustFlipVertically);
}
-
+
/**
* Read the drawable's pixels to TextureData and Texture, if requested at construction.
- *
+ *
* @param gl the current GL context object. It's read drawable is being used as the pixel source.
* @param inX readPixel x offset
* @param inY readPixel y offset
- * @param inWidth optional readPixel width value, used if [1 .. drawable.width], otherwise using drawable.width
+ * @param inWidth optional readPixel width value, used if [1 .. drawable.width], otherwise using drawable.width
* @param inHeight optional readPixel height, used if [1 .. drawable.height], otherwise using drawable.height
* @param mustFlipVertically indicates whether to flip the data vertically or not.
* The context's drawable {@link GLDrawable#isGLOriented()} state
@@ -174,17 +174,17 @@ public class GLReadBufferUtil {
} else {
height= inHeight;
}
-
+
final boolean flipVertically;
if( drawable.isGLOriented() ) {
flipVertically = mustFlipVertically;
} else {
flipVertically = !mustFlipVertically;
}
-
+
final int tmp[] = new int[1];
final int readPixelSize = GLBuffers.sizeof(gl, tmp, pixelAttribs.bytesPerPixel, width, height, 1, true);
-
+
boolean newData = false;
if( null == readPixelBuffer || readPixelBuffer.requiresNewBuffer(gl, width, height, readPixelSize) ) {
readPixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, width, height, 1, true, readPixelSize);
@@ -194,9 +194,9 @@ public class GLReadBufferUtil {
gl.getGLProfile(),
internalFormat,
width, height,
- 0,
+ 0,
pixelAttribs,
- false, false,
+ false, false,
flipVertically,
readPixelBuffer.buffer,
null /* Flusher */);
@@ -230,13 +230,13 @@ public class GLReadBufferUtil {
" "+width+"x"+height+
", "+pixelAttribs+
", "+readPixelBuffer+", sz "+readPixelSize);
- res = false;
+ res = false;
}
if(res && null != readTexture) {
if(newData) {
readTexture.updateImage(gl, readTextureData);
} else {
- readTexture.updateSubImage(gl, readTextureData, 0,
+ readTexture.updateSubImage(gl, readTextureData, 0,
0, 0, // src offset
0, 0, // dst offset
width, height);
@@ -248,7 +248,7 @@ public class GLReadBufferUtil {
return res;
}
- public void dispose(GL gl) {
+ public void dispose(GL gl) {
if(null != readTexture) {
readTexture.destroy(gl);
readTextureData = null;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
index c649d1c6a..966781906 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
index 111e2509e..697b7cca0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
@@ -34,28 +34,28 @@ import com.jogamp.opengl.util.glsl.ShaderState;
* to be either rendered directly via {@link #glEnd(GL)} or to be added to an internal display list
* via {@link #glEnd(GL, boolean) glEnd(gl, false)} for deferred rendering via {@link #draw(GL, boolean)}.
*
- * If unsure whether colors, normals and textures will be used,
+ * If unsure whether colors, normals and textures will be used,
* simply add them with an expected component count.
* This implementation will only render buffers which are being filled.
* The buffer growing implementation will only grow the exceeded buffers, unused buffers are not resized.
*
*
- * Note: Optional types, i.e. color, must be either not used or used w/ the same element count as vertex, etc.
+ * Note: Optional types, i.e. color, must be either not used or used w/ the same element count as vertex, etc.
* This is a semantic constraint, same as in the original OpenGL spec.
*
*/
public class ImmModeSink {
protected static final boolean DEBUG_BEGIN_END;
- protected static final boolean DEBUG_DRAW;
+ protected static final boolean DEBUG_DRAW;
protected static final boolean DEBUG_BUFFER;
-
+
static {
Debug.initSingleton();
DEBUG_BEGIN_END = Debug.isPropertyDefined("jogl.debug.ImmModeSink.BeginEnd", true);
- DEBUG_DRAW = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Draw", true);
+ DEBUG_DRAW = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Draw", true);
DEBUG_BUFFER = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Buffer", true);
}
@@ -68,7 +68,7 @@ public class ImmModeSink {
*
- *
+ *
* @param initialElementCount initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
* @param vComps mandatory vertex component count, should be 2, 3 or 4.
* @param vDataType mandatory vertex data type, e.g. {@link GL#GL_FLOAT}
@@ -78,17 +78,17 @@ public class ImmModeSink {
* @param nDataType optional normal data type, e.g. {@link GL#GL_FLOAT}
* @param tComps optional texture-coordinate component count, may be 0, 2 or 3
* @param tDataType optional texture-coordinate data type, e.g. {@link GL#GL_FLOAT}
- * @param glBufferUsage VBO usage parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
+ * @param glBufferUsage VBO usage parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
* set to 0 for no VBO usage
*/
- public static ImmModeSink createFixed(int initialElementCount,
+ public static ImmModeSink createFixed(int initialElementCount,
int vComps, int vDataType,
int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType,
int glBufferUsage) {
- return new ImmModeSink(initialElementCount,
- vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
+ return new ImmModeSink(initialElementCount,
+ vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
false, glBufferUsage, null, 0);
}
@@ -97,7 +97,7 @@ public class ImmModeSink {
*
- *
+ *
* @param initialElementCount initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
* @param vComps mandatory vertex component count, should be 2, 3 or 4.
* @param vDataType mandatory vertex data type, e.g. {@link GL#GL_FLOAT}
@@ -107,21 +107,21 @@ public class ImmModeSink {
* @param nDataType optional normal data type, e.g. {@link GL#GL_FLOAT}
* @param tComps optional texture-coordinate component count, may be 0, 2 or 3
* @param tDataType optional texture-coordinate data type, e.g. {@link GL#GL_FLOAT}
- * @param glBufferUsage VBO usage parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
+ * @param glBufferUsage VBO usage parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
* set to 0 for no VBO usage
* @param st ShaderState to locate the vertex attributes
* @see #draw(GL, boolean)
* @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
* @see com.jogamp.opengl.util.glsl.ShaderState#getCurrentShaderState()
*/
- public static ImmModeSink createGLSL(int initialElementCount,
+ public static ImmModeSink createGLSL(int initialElementCount,
int vComps, int vDataType,
int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType,
int glBufferUsage, ShaderState st) {
- return new ImmModeSink(initialElementCount,
- vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
+ return new ImmModeSink(initialElementCount,
+ vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
true, glBufferUsage, st, 0);
}
@@ -130,7 +130,7 @@ public class ImmModeSink {
*
- *
+ *
* @param initialElementCount initial buffer size, if subsequent mutable operations are about to exceed the buffer size, the buffer will grow about the initial size.
* @param vComps mandatory vertex component count, should be 2, 3 or 4.
* @param vDataType mandatory vertex data type, e.g. {@link GL#GL_FLOAT}
@@ -140,24 +140,24 @@ public class ImmModeSink {
* @param nDataType optional normal data type, e.g. {@link GL#GL_FLOAT}
* @param tComps optional texture-coordinate component count, may be 0, 2 or 3
* @param tDataType optional texture-coordinate data type, e.g. {@link GL#GL_FLOAT}
- * @param glBufferUsage VBO usage parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
+ * @param glBufferUsage VBO usage parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
* set to 0 for no VBO usage
* @param shaderProgram shader-program name to locate the vertex attributes
* @see #draw(GL, boolean)
* @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
* @see com.jogamp.opengl.util.glsl.ShaderState#getCurrentShaderState()
*/
- public static ImmModeSink createGLSL(int initialElementCount,
+ public static ImmModeSink createGLSL(int initialElementCount,
int vComps, int vDataType,
int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType,
int glBufferUsage, int shaderProgram) {
- return new ImmModeSink(initialElementCount,
- vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
+ return new ImmModeSink(initialElementCount,
+ vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
true, glBufferUsage, null, shaderProgram);
}
-
+
public void destroy(GL gl) {
destroyList(gl);
@@ -346,7 +346,7 @@ public class ImmModeSink {
public final void glColor3ub(byte x, byte y, byte z) {
vboSet.glColor3ub(x,y,z);
}
-
+
public final void glColor4b(byte x, byte y, byte z, byte a) {
vboSet.glColor4b(x,y,z,a);
}
@@ -354,7 +354,7 @@ public class ImmModeSink {
public final void glColor4ub(byte x, byte y, byte z, byte a) {
vboSet.glColor4ub(x,y,z,a);
}
-
+
public final void glTexCoord2b(byte x, byte y) {
vboSet.glTexCoord2b(x,y);
}
@@ -363,26 +363,26 @@ public class ImmModeSink {
vboSet.glTexCoord3b(x,y,z);
}
- protected ImmModeSink(int initialElementCount,
- int vComps, int vDataType,
- int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
+ protected ImmModeSink(int initialElementCount,
+ int vComps, int vDataType,
+ int cComps, int cDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType,
boolean useGLSL, int glBufferUsage, ShaderState st, int shaderProgram) {
- vboSet = new VBOSet(initialElementCount,
- vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
+ vboSet = new VBOSet(initialElementCount,
+ vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
useGLSL, glBufferUsage, st, shaderProgram);
this.vboSetList = new ArrayList();
}
-
+
public boolean getUseVBO() { return vboSet.getUseVBO(); }
-
+
/**
* Returns the additional element count if buffer resize is required.
* @see #setResizeElementCount(int)
*/
public int getResizeElementCount() { return vboSet.getResizeElementCount(); }
-
+
/**
* Sets the additional element count if buffer resize is required,
* defaults to initialElementCount of factory method.
@@ -390,7 +390,7 @@ public class ImmModeSink {
* @see #createGLSL(int, int, int, int, int, int, int, int, int, int, ShaderState)
*/
public void setResizeElementCount(int v) { vboSet.setResizeElementCount(v); }
-
+
private void destroyList(GL gl) {
for(int i=0; i vboSetList;
protected static class VBOSet {
- protected VBOSet (int initialElementCount,
- int vComps, int vDataType,
- int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
+ protected VBOSet (int initialElementCount,
+ int vComps, int vDataType,
+ int cComps, int cDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType,
boolean useGLSL, int glBufferUsage, ShaderState st, int shaderProgram) {
// final ..
this.glBufferUsage=glBufferUsage;
@@ -415,7 +415,7 @@ public class ImmModeSink {
this.useGLSL=useGLSL;
this.shaderState = st;
this.shaderProgram = shaderProgram;
-
+
if(useGLSL && null == shaderState && 0 == shaderProgram) {
throw new IllegalArgumentException("Using GLSL but neither a valid shader-program nor ShaderState has been passed!");
}
@@ -436,9 +436,9 @@ public class ImmModeSink {
this.tDataType=tDataType;
this.tDataTypeSigned=GLBuffers.isSignedGLType(tDataType);
this.tComps=tComps;
- this.tCompsBytes=tComps * GLBuffers.sizeOfGLType(tDataType);
+ this.tCompsBytes=tComps * GLBuffers.sizeOfGLType(tDataType);
this.vboName = 0;
-
+
this.vCount=0;
this.cCount=0;
this.nCount=0;
@@ -447,9 +447,9 @@ public class ImmModeSink {
this.cElems=0;
this.nElems=0;
this.tElems=0;
-
+
this.pageSize = Platform.getMachineDescription().pageSizeInBytes();
-
+
reallocateBuffer(initialElementCount);
rewind();
@@ -465,30 +465,30 @@ public class ImmModeSink {
protected int getResizeElementCount() { return resizeElementCount; }
protected void setResizeElementCount(int v) { resizeElementCount=v; }
-
+
protected boolean getUseVBO() { return useVBO; }
-
+
protected final VBOSet regenerate(GL gl) {
- return new VBOSet(initialElementCount, vComps,
- vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
+ return new VBOSet(initialElementCount, vComps,
+ vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
useGLSL, glBufferUsage, shaderState, shaderProgram);
}
protected void checkSeal(boolean test) throws GLException {
if(0==mode) {
- throw new GLException("No mode set yet, call glBegin(mode) first:\n\t"+this);
+ throw new GLException("No mode set yet, call glBegin(mode) first:\n\t"+this);
}
if(sealed!=test) {
if(test) {
- throw new GLException("Not Sealed yet, call glEnd() first:\n\t"+this);
+ throw new GLException("Not Sealed yet, call glEnd() first:\n\t"+this);
} else {
- throw new GLException("Already Sealed, can't modify VBO after glEnd():\n\t"+this);
+ throw new GLException("Already Sealed, can't modify VBO after glEnd():\n\t"+this);
}
}
}
private boolean usingShaderProgram = false;
-
+
protected void useShaderProgram(GL2ES2 gl, boolean force) {
if( force || !usingShaderProgram ) {
if(null != shaderState) {
@@ -499,19 +499,19 @@ public class ImmModeSink {
usingShaderProgram = true;
}
}
-
+
protected void draw(GL gl, Buffer indices, boolean disableBufferAfterDraw, int i)
{
enableBuffer(gl, true);
-
+
if(null != shaderState || 0 != shaderProgram) {
useShaderProgram(gl.getGL2ES2(), false);
}
-
+
if(DEBUG_DRAW) {
System.err.println("ImmModeSink.draw["+i+"].0 (disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
}
-
+
if (buffer!=null) {
if(null==indices) {
if ( GL_QUADS == mode && !gl.isGL2() ) {
@@ -523,7 +523,7 @@ public class ImmModeSink {
}
} else {
// FIXME: Impl. VBO usage .. or unroll.
- if( !gl.getContext().isCPUDataSourcingAvail() ) {
+ if( !gl.getContext().isCPUDataSourcingAvail() ) {
throw new GLException("CPU data sourcing n/a w/ "+gl.getContext());
}
final int type;
@@ -538,23 +538,23 @@ public class ImmModeSink {
}
final int idxLen = indices.remaining();
final int idx0 = indices.position();
-
+
if ( GL_QUADS == mode && !gl.isGL2() ) {
if( GL.GL_UNSIGNED_BYTE == type ) {
final ByteBuffer b = (ByteBuffer) indices;
for (int j = 0; j < idxLen; j++) {
gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(idx0+j)), 4);
- }
+ }
} else if( GL.GL_UNSIGNED_SHORT == type ){
final ShortBuffer b = (ShortBuffer) indices;
for (int j = 0; j < idxLen; j++) {
gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(idx0+j)), 4);
- }
+ }
} else {
final IntBuffer b = (IntBuffer) indices;
for (int j = 0; j < idxLen; j++) {
gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4);
- }
+ }
}
} else {
((GL2ES1)gl).glDrawElements(mode, idxLen, type, indices);
@@ -566,7 +566,7 @@ public class ImmModeSink {
if(disableBufferAfterDraw) {
enableBuffer(gl, false);
}
-
+
if(DEBUG_DRAW) {
System.err.println("ImmModeSink.draw["+i+"].X (disableBufferAfterDraw: "+disableBufferAfterDraw+")");
}
@@ -592,7 +592,7 @@ public class ImmModeSink {
public void glVertex2b(byte x, byte y) {
checkSeal(false);
growBuffer(VERTEX);
- if(vComps>0)
+ if(vComps>0)
Buffers.putNb(vertexArray, vDataTypeSigned, x, true);
if(vComps>1)
Buffers.putNb(vertexArray, vDataTypeSigned, y, true);
@@ -614,7 +614,7 @@ public class ImmModeSink {
growBuffer(VERTEX);
if(vComps>0)
Buffers.putNs(vertexArray, vDataTypeSigned, x, true);
- if(vComps>1)
+ if(vComps>1)
Buffers.putNs(vertexArray, vDataTypeSigned, y, true);
countAndPadding(VERTEX, vComps-2);
}
@@ -623,16 +623,16 @@ public class ImmModeSink {
growBuffer(VERTEX);
if(vComps>0)
Buffers.putNs(vertexArray, vDataTypeSigned, x, true);
- if(vComps>1)
+ if(vComps>1)
Buffers.putNs(vertexArray, vDataTypeSigned, y, true);
- if(vComps>2)
+ if(vComps>2)
Buffers.putNs(vertexArray, vDataTypeSigned, z, true);
countAndPadding(VERTEX, vComps-3);
}
public void glVertex2f(float x, float y) {
checkSeal(false);
growBuffer(VERTEX);
- if(vComps>0)
+ if(vComps>0)
Buffers.putNf(vertexArray, vDataTypeSigned, x);
if(vComps>1)
Buffers.putNf(vertexArray, vDataTypeSigned, y);
@@ -641,11 +641,11 @@ public class ImmModeSink {
public void glVertex3f(float x, float y, float z) {
checkSeal(false);
growBuffer(VERTEX);
- if(vComps>0)
+ if(vComps>0)
Buffers.putNf(vertexArray, vDataTypeSigned, x);
if(vComps>1)
Buffers.putNf(vertexArray, vDataTypeSigned, y);
- if(vComps>2)
+ if(vComps>2)
Buffers.putNf(vertexArray, vDataTypeSigned, z);
countAndPadding(VERTEX, vComps-3);
}
@@ -653,33 +653,33 @@ public class ImmModeSink {
public void glNormal3b(byte x, byte y, byte z) {
checkSeal(false);
growBuffer(NORMAL);
- if(nComps>0)
+ if(nComps>0)
Buffers.putNb(normalArray, nDataTypeSigned, x, true);
- if(nComps>1)
+ if(nComps>1)
Buffers.putNb(normalArray, nDataTypeSigned, y, true);
- if(nComps>2)
+ if(nComps>2)
Buffers.putNb(normalArray, nDataTypeSigned, z, true);
countAndPadding(NORMAL, nComps-3);
}
public void glNormal3s(short x, short y, short z) {
checkSeal(false);
growBuffer(NORMAL);
- if(nComps>0)
+ if(nComps>0)
Buffers.putNs(normalArray, nDataTypeSigned, x, true);
- if(nComps>1)
+ if(nComps>1)
Buffers.putNs(normalArray, nDataTypeSigned, y, true);
- if(nComps>2)
+ if(nComps>2)
Buffers.putNs(normalArray, nDataTypeSigned, z, true);
countAndPadding(NORMAL, nComps-3);
}
public void glNormal3f(float x, float y, float z) {
checkSeal(false);
growBuffer(NORMAL);
- if(nComps>0)
+ if(nComps>0)
Buffers.putNf(normalArray, nDataTypeSigned, x);
if(nComps>1)
Buffers.putNf(normalArray, nDataTypeSigned, y);
- if(nComps>2)
+ if(nComps>2)
Buffers.putNf(normalArray, nDataTypeSigned, z);
countAndPadding(NORMAL, nComps-3);
}
@@ -687,96 +687,96 @@ public class ImmModeSink {
public void glColor3b(byte r, byte g, byte b) {
checkSeal(false);
growBuffer(COLOR);
- if(cComps>0)
+ if(cComps>0)
Buffers.putNb(colorArray, cDataTypeSigned, r, true);
- if(cComps>1)
+ if(cComps>1)
Buffers.putNb(colorArray, cDataTypeSigned, g, true);
- if(cComps>2)
+ if(cComps>2)
Buffers.putNb(colorArray, cDataTypeSigned, b, true);
countAndPadding(COLOR, cComps-3);
}
public void glColor3ub(byte r, byte g, byte b) {
checkSeal(false);
growBuffer(COLOR);
- if(cComps>0)
+ if(cComps>0)
Buffers.putNb(colorArray, cDataTypeSigned, r, false);
- if(cComps>1)
+ if(cComps>1)
Buffers.putNb(colorArray, cDataTypeSigned, g, false);
- if(cComps>2)
+ if(cComps>2)
Buffers.putNb(colorArray, cDataTypeSigned, b, false);
countAndPadding(COLOR, cComps-3);
}
public void glColor4b(byte r, byte g, byte b, byte a) {
checkSeal(false);
growBuffer(COLOR);
- if(cComps>0)
+ if(cComps>0)
Buffers.putNb(colorArray, cDataTypeSigned, r, true);
- if(cComps>1)
+ if(cComps>1)
Buffers.putNb(colorArray, cDataTypeSigned, g, true);
- if(cComps>2)
+ if(cComps>2)
Buffers.putNb(colorArray, cDataTypeSigned, b, true);
- if(cComps>3)
+ if(cComps>3)
Buffers.putNb(colorArray, cDataTypeSigned, a, true);
countAndPadding(COLOR, cComps-4);
}
public void glColor4ub(byte r, byte g, byte b, byte a) {
checkSeal(false);
growBuffer(COLOR);
- if(cComps>0)
+ if(cComps>0)
Buffers.putNb(colorArray, cDataTypeSigned, r, false);
- if(cComps>1)
+ if(cComps>1)
Buffers.putNb(colorArray, cDataTypeSigned, g, false);
- if(cComps>2)
+ if(cComps>2)
Buffers.putNb(colorArray, cDataTypeSigned, b, false);
- if(cComps>3)
+ if(cComps>3)
Buffers.putNb(colorArray, cDataTypeSigned, a, false);
countAndPadding(COLOR, cComps-4);
}
public void glColor3s(short r, short g, short b) {
checkSeal(false);
growBuffer(COLOR);
- if(cComps>0)
+ if(cComps>0)
Buffers.putNs(colorArray, cDataTypeSigned, r, true);
- if(cComps>1)
+ if(cComps>1)
Buffers.putNs(colorArray, cDataTypeSigned, g, true);
- if(cComps>2)
+ if(cComps>2)
Buffers.putNs(colorArray, cDataTypeSigned, b, true);
countAndPadding(COLOR, cComps-3);
}
public void glColor4s(short r, short g, short b, short a) {
checkSeal(false);
growBuffer(COLOR);
- if(cComps>0)
+ if(cComps>0)
Buffers.putNs(colorArray, cDataTypeSigned, r, true);
- if(cComps>1)
+ if(cComps>1)
Buffers.putNs(colorArray, cDataTypeSigned, g, true);
- if(cComps>2)
+ if(cComps>2)
Buffers.putNs(colorArray, cDataTypeSigned, b, true);
- if(cComps>3)
+ if(cComps>3)
Buffers.putNs(colorArray, cDataTypeSigned, a, true);
countAndPadding(COLOR, cComps-4);
}
public void glColor3f(float r, float g, float b) {
checkSeal(false);
growBuffer(COLOR);
- if(cComps>0)
+ if(cComps>0)
Buffers.putNf(colorArray, cDataTypeSigned, r);
- if(cComps>1)
+ if(cComps>1)
Buffers.putNf(colorArray, cDataTypeSigned, g);
- if(cComps>2)
+ if(cComps>2)
Buffers.putNf(colorArray, cDataTypeSigned, b);
countAndPadding(COLOR, cComps-3);
}
public void glColor4f(float r, float g, float b, float a) {
checkSeal(false);
growBuffer(COLOR);
- if(cComps>0)
+ if(cComps>0)
Buffers.putNf(colorArray, cDataTypeSigned, r);
- if(cComps>1)
+ if(cComps>1)
Buffers.putNf(colorArray, cDataTypeSigned, g);
- if(cComps>2)
+ if(cComps>2)
Buffers.putNf(colorArray, cDataTypeSigned, b);
- if(cComps>3)
+ if(cComps>3)
Buffers.putNf(colorArray, cDataTypeSigned, a);
countAndPadding(COLOR, cComps-4);
}
@@ -784,60 +784,60 @@ public class ImmModeSink {
public void glTexCoord2b(byte x, byte y) {
checkSeal(false);
growBuffer(TEXTCOORD);
- if(tComps>0)
+ if(tComps>0)
Buffers.putNb(textCoordArray, tDataTypeSigned, x, true);
- if(tComps>1)
+ if(tComps>1)
Buffers.putNb(textCoordArray, tDataTypeSigned, y, true);
countAndPadding(TEXTCOORD, tComps-2);
}
public void glTexCoord3b(byte x, byte y, byte z) {
checkSeal(false);
growBuffer(TEXTCOORD);
- if(tComps>0)
+ if(tComps>0)
Buffers.putNb(textCoordArray, tDataTypeSigned, x, true);
- if(tComps>1)
+ if(tComps>1)
Buffers.putNb(textCoordArray, tDataTypeSigned, y, true);
- if(tComps>2)
+ if(tComps>2)
Buffers.putNb(textCoordArray, tDataTypeSigned, z, true);
countAndPadding(TEXTCOORD, tComps-3);
}
public void glTexCoord2s(short x, short y) {
checkSeal(false);
growBuffer(TEXTCOORD);
- if(tComps>0)
+ if(tComps>0)
Buffers.putNs(textCoordArray, tDataTypeSigned, x, true);
- if(tComps>1)
+ if(tComps>1)
Buffers.putNs(textCoordArray, tDataTypeSigned, y, true);
countAndPadding(TEXTCOORD, tComps-2);
}
public void glTexCoord3s(short x, short y, short z) {
checkSeal(false);
growBuffer(TEXTCOORD);
- if(tComps>0)
+ if(tComps>0)
Buffers.putNs(textCoordArray, tDataTypeSigned, x, true);
- if(tComps>1)
+ if(tComps>1)
Buffers.putNs(textCoordArray, tDataTypeSigned, y, true);
- if(tComps>2)
+ if(tComps>2)
Buffers.putNs(textCoordArray, tDataTypeSigned, z, true);
countAndPadding(TEXTCOORD, tComps-3);
}
public void glTexCoord2f(float x, float y) {
checkSeal(false);
growBuffer(TEXTCOORD);
- if(tComps>0)
+ if(tComps>0)
Buffers.putNf(textCoordArray, tDataTypeSigned, x);
- if(tComps>1)
+ if(tComps>1)
Buffers.putNf(textCoordArray, tDataTypeSigned, y);
countAndPadding(TEXTCOORD, tComps-2);
}
public void glTexCoord3f(float x, float y, float z) {
checkSeal(false);
growBuffer(TEXTCOORD);
- if(tComps>0)
+ if(tComps>0)
Buffers.putNf(textCoordArray, tDataTypeSigned, x);
- if(tComps>1)
+ if(tComps>1)
Buffers.putNf(textCoordArray, tDataTypeSigned, y);
- if(tComps>2)
+ if(tComps>2)
Buffers.putNf(textCoordArray, tDataTypeSigned, z);
countAndPadding(TEXTCOORD, tComps-3);
}
@@ -864,20 +864,20 @@ public class ImmModeSink {
shaderProgram = program;
glslLocationSet = false; // enforce location reset!
}
-
+
/**
* @param gl
* @return true if all locations for all used arrays are found (min 1 array), otherwise false.
- * Also sets 'glslLocationSet' to the return value!
+ * Also sets 'glslLocationSet' to the return value!
*/
private boolean resetGLSLArrayLocation(GL2ES2 gl) {
int iA = 0;
int iL = 0;
-
+
if(null != vArrayData) {
iA++;
if( vArrayData.setLocation(gl, shaderProgram) >= 0 ) {
- iL++;
+ iL++;
}
}
if(null != cArrayData) {
@@ -901,7 +901,7 @@ public class ImmModeSink {
glslLocationSet = iA == iL;
return glslLocationSet;
}
-
+
public void destroy(GL gl) {
reset(gl);
@@ -931,7 +931,7 @@ public class ImmModeSink {
this.vElems=0;
this.cElems=0;
this.nElems=0;
- this.tElems=0;
+ this.tElems=0;
}
public void seal(GL glObj, boolean seal)
@@ -1016,20 +1016,20 @@ public class ImmModeSink {
}
} else {
gl.glBufferData(GL.GL_ARRAY_BUFFER, buffer.limit(), buffer, glBufferUsage);
- bufferWrittenOnce = true;
- }
+ bufferWrittenOnce = true;
+ }
}
-
+
private void enableBufferFixed(GL gl, boolean enable) {
GL2ES1 glf = gl.getGL2ES1();
-
+
final boolean useV = vComps>0 && vElems>0 ;
final boolean useC = cComps>0 && cElems>0 ;
final boolean useN = nComps>0 && nElems>0 ;
final boolean useT = tComps>0 && tElems>0 ;
-
+
if(DEBUG_DRAW) {
- System.err.println("ImmModeSink.enableFixed.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
+ System.err.println("ImmModeSink.enableFixed.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
}
if(enable) {
@@ -1038,7 +1038,7 @@ public class ImmModeSink {
throw new InternalError("Using VBO but no vboName");
}
glf.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName);
-
+
if(!bufferWritten) {
writeBuffer(gl);
}
@@ -1051,7 +1051,7 @@ public class ImmModeSink {
glf.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
glf.glVertexPointer(vArrayData);
} else {
- glf.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+ glf.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
}
}
if(useC) {
@@ -1082,24 +1082,24 @@ public class ImmModeSink {
if(enable && useVBO) {
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
}
-
+
if(DEBUG_DRAW) {
- System.err.println("ImmModeSink.enableFixed.X ");
+ System.err.println("ImmModeSink.enableFixed.X ");
}
}
private void enableBufferGLSLShaderState(GL gl, boolean enable) {
GL2ES2 glsl = gl.getGL2ES2();
-
+
final boolean useV = vComps>0 && vElems>0 ;
final boolean useC = cComps>0 && cElems>0 ;
final boolean useN = nComps>0 && nElems>0 ;
final boolean useT = tComps>0 && tElems>0 ;
-
+
if(DEBUG_DRAW) {
- System.err.println("ImmModeSink.enableGLSL.A.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
+ System.err.println("ImmModeSink.enableGLSL.A.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
}
-
+
if(enable) {
if(useVBO) {
if(0 == vboName) {
@@ -1110,9 +1110,9 @@ public class ImmModeSink {
writeBuffer(gl);
}
}
- bufferWritten=true;
+ bufferWritten=true;
}
-
+
if(useV) {
if(enable) {
shaderState.enableVertexAttribArray(glsl, vArrayData);
@@ -1144,30 +1144,30 @@ public class ImmModeSink {
} else {
shaderState.disableVertexAttribArray(glsl, tArrayData);
}
- }
+ }
glslLocationSet = true; // ShaderState does set the location implicit
-
+
if(enable && useVBO) {
glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
}
-
+
if(DEBUG_DRAW) {
- System.err.println("ImmModeSink.enableGLSL.A.X ");
+ System.err.println("ImmModeSink.enableGLSL.A.X ");
}
}
private void enableBufferGLSLSimple(GL gl, boolean enable) {
GL2ES2 glsl = gl.getGL2ES2();
-
+
final boolean useV = vComps>0 && vElems>0 ;
final boolean useC = cComps>0 && cElems>0 ;
final boolean useN = nComps>0 && nElems>0 ;
final boolean useT = tComps>0 && tElems>0 ;
-
+
if(DEBUG_DRAW) {
- System.err.println("ImmModeSink.enableGLSL.B.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
+ System.err.println("ImmModeSink.enableGLSL.B.0 "+enable+": use [ v "+useV+", c "+useC+", n "+useN+", t "+useT+"], "+getElemUseCountStr()+", "+buffer);
}
-
+
if(!glslLocationSet) {
if( !resetGLSLArrayLocation(glsl) ) {
if(DEBUG_DRAW) {
@@ -1180,7 +1180,7 @@ public class ImmModeSink {
return;
}
}
-
+
if(enable) {
if(useVBO) {
if(0 == vboName) {
@@ -1226,28 +1226,28 @@ public class ImmModeSink {
glsl.glDisableVertexAttribArray(tArrayData.getLocation());
}
}
-
+
if(enable && useVBO) {
glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
}
-
+
if(DEBUG_DRAW) {
- System.err.println("ImmModeSink.enableGLSL.B.X ");
+ System.err.println("ImmModeSink.enableGLSL.B.X ");
}
}
-
+
public String toString() {
- final String glslS = useGLSL ?
+ final String glslS = useGLSL ?
", useShaderState "+(null!=shaderState)+
", shaderProgram "+shaderProgram+
", glslLocationSet "+glslLocationSet : "";
-
- return "VBOSet[mode "+mode+
- ", modeOrig "+modeOrig+
+
+ return "VBOSet[mode "+mode+
+ ", modeOrig "+modeOrig+
", use/count "+getElemUseCountStr()+
- ", sealed "+sealed+
+ ", sealed "+sealed+
", sealedGL "+sealedGL+
- ", bufferEnabled "+bufferEnabled+
+ ", bufferEnabled "+bufferEnabled+
", bufferWritten "+bufferWritten+" (once "+bufferWrittenOnce+")"+
", useVBO "+useVBO+", vboName "+vboName+
", useGLSL "+useGLSL+
@@ -1264,7 +1264,7 @@ public class ImmModeSink {
protected String getElemUseCountStr() {
return "[v "+vElems+"/"+vCount+", c "+cElems+"/"+cCount+", n "+nElems+"/"+nCount+", t "+tElems+"/"+tCount+"]";
}
-
+
protected boolean fitElementInBuffer(int type) {
final int addElems = 1;
switch (type) {
@@ -1280,20 +1280,20 @@ public class ImmModeSink {
throw new InternalError("XXX");
}
}
-
+
protected boolean reallocateBuffer(int addElems) {
final int vAdd = addElems - ( vCount - vElems );
final int cAdd = addElems - ( cCount - cElems );
final int nAdd = addElems - ( nCount - nElems );
final int tAdd = addElems - ( tCount - tElems );
-
+
if( 0>=vAdd && 0>=cAdd && 0>=nAdd && 0>=tAdd) {
if(DEBUG_BUFFER) {
System.err.println("ImmModeSink.realloc: "+getElemUseCountStr()+" + "+addElems+" -> NOP");
}
return false;
}
-
+
if(DEBUG_BUFFER) {
System.err.println("ImmModeSink.realloc: "+getElemUseCountStr()+" + "+addElems);
}
@@ -1301,20 +1301,20 @@ public class ImmModeSink {
cCount += cAdd;
nCount += nAdd;
tCount += tAdd;
-
+
final int vBytes = vCount * vCompsBytes;
final int cBytes = cCount * cCompsBytes;
final int nBytes = nCount * nCompsBytes;
final int tBytes = tCount * tCompsBytes;
-
+
buffer = Buffers.newDirectByteBuffer( vBytes + cBytes + nBytes + tBytes );
vOffset = 0;
-
+
if(vBytes>0) {
vertexArray = GLBuffers.sliceGLBuffer(buffer, vOffset, vBytes, vDataType);
} else {
vertexArray = null;
- }
+ }
cOffset=vOffset+vBytes;
if(cBytes>0) {
@@ -1341,36 +1341,36 @@ public class ImmModeSink {
buffer.flip();
if(vComps>0) {
- vArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, vComps,
+ vArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, vComps,
vDataType, GLBuffers.isGLTypeFixedPoint(vDataType), 0,
vertexArray, 0, vOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
} else {
vArrayData = null;
}
if(cComps>0) {
- cArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_COLOR_ARRAY, cComps,
+ cArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_COLOR_ARRAY, cComps,
cDataType, GLBuffers.isGLTypeFixedPoint(cDataType), 0,
colorArray, 0, cOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
} else {
cArrayData = null;
}
if(nComps>0) {
- nArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_NORMAL_ARRAY, nComps,
+ nArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_NORMAL_ARRAY, nComps,
nDataType, GLBuffers.isGLTypeFixedPoint(nDataType), 0,
normalArray, 0, nOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
} else {
nArrayData = null;
}
if(tComps>0) {
- tArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, tComps,
+ tArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, tComps,
tDataType, GLBuffers.isGLTypeFixedPoint(tDataType), 0,
textCoordArray, 0, tOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
} else {
tArrayData = null;
}
-
+
bufferWrittenOnce = false; // new buffer data storage size!
-
+
if(DEBUG_BUFFER) {
System.err.println("ImmModeSink.realloc.X: "+this.toString());
Thread.dumpStack();
@@ -1384,7 +1384,7 @@ public class ImmModeSink {
if( !fitElementInBuffer(type) ) {
// save olde values ..
final Buffer _vertexArray=vertexArray, _colorArray=colorArray, _normalArray=normalArray, _textCoordArray=textCoordArray;
-
+
if ( reallocateBuffer(resizeElementCount) ) {
if(null!=_vertexArray) {
_vertexArray.flip();
@@ -1416,7 +1416,7 @@ public class ImmModeSink {
* vec4 v = vec4(0, 0, 0, 1);
* vec4 c = vec4(0, 0, 0, 1);
*
- *
+ *
* @param type
* @param fill
*/
@@ -1426,7 +1426,7 @@ public class ImmModeSink {
final Buffer dest;
final boolean dSigned;
final int e; // either 0 or 1
-
+
switch (type) {
case VERTEX:
dest = vertexArray;
@@ -1459,7 +1459,7 @@ public class ImmModeSink {
while( fill > e ) {
fill--;
- Buffers.putNf(dest, dSigned, 0f);
+ Buffers.putNf(dest, dSigned, 0f);
}
if( fill > 0 ) { // e == 1, add missing '1f end component'
Buffers.putNf(dest, dSigned, 1f);
@@ -1480,18 +1480,18 @@ public class ImmModeSink {
private static final int NORMAL = 2;
private static final int TEXTCOORD = 3;
- private int vCount, cCount, nCount, tCount; // number of elements fit in each buffer
+ private int vCount, cCount, nCount, tCount; // number of elements fit in each buffer
private int vOffset, cOffset, nOffset, tOffset; // offset of specific array in common buffer
private int vElems, cElems, nElems, tElems; // number of used elements in each buffer
- private final int vComps, cComps, nComps, tComps; // number of components for each elements [2, 3, 4]
- private final int vCompsBytes, cCompsBytes, nCompsBytes, tCompsBytes; // byte size of all components
+ private final int vComps, cComps, nComps, tComps; // number of components for each elements [2, 3, 4]
+ private final int vCompsBytes, cCompsBytes, nCompsBytes, tCompsBytes; // byte size of all components
private final int vDataType, cDataType, nDataType, tDataType;
private final boolean vDataTypeSigned, cDataTypeSigned, nDataTypeSigned, tDataTypeSigned;
private final int pageSize;
private Buffer vertexArray, colorArray, normalArray, textCoordArray;
private GLArrayDataWrapper vArrayData, cArrayData, nArrayData, tArrayData;
- private boolean sealed, sealedGL;
+ private boolean sealed, sealedGL;
private boolean bufferEnabled, bufferWritten, bufferWrittenOnce;
private boolean glslLocationSet;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
index 58151856f..b4a0156e9 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2009 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,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 com.jogamp.opengl.util;
@@ -55,22 +55,22 @@ import com.jogamp.opengl.math.geom.Frustum;
* regarding the projection (P), modelview (Mv) matrix operation
* which is specified in {@link GLMatrixFunc}.
*
- * Further more, PMVMatrix provides the {@link #glGetMviMatrixf() inverse modelview matrix (Mvi)} and
+ * Further more, PMVMatrix provides the {@link #glGetMviMatrixf() inverse modelview matrix (Mvi)} and
* {@link #glGetMvitMatrixf() inverse transposed modelview matrix (Mvit)}.
* {@link Frustum} is also provided by {@link #glGetFrustum()}.
* To keep these derived values synchronized after mutable Mv operations like {@link #glRotatef(float, float, float, float) glRotatef(..)}
- * in {@link #glMatrixMode(int) glMatrixMode}({@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}),
- * users have to call {@link #update()} before using Mvi and Mvit.
+ * in {@link #glMatrixMode(int) glMatrixMode}({@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}),
+ * users have to call {@link #update()} before using Mvi and Mvit.
*
*
- * All matrices are provided in column-major order,
- * as specified in the OpenGL fixed function pipeline, i.e. compatibility profile.
+ * All matrices are provided in column-major order,
+ * as specified in the OpenGL fixed function pipeline, i.e. compatibility profile.
*
*
- * PMVMatrix can supplement {@link GL2ES2} applications w/ the
+ * PMVMatrix can supplement {@link GL2ES2} applications w/ the
* lack of the described matrix functionality.
*
* All matrices use a common FloatBuffer storage
* and are a {@link Buffers#slice2Float(Buffer, float[], int, int) sliced} representation of it.
@@ -78,11 +78,11 @@ import com.jogamp.opengl.math.geom.Frustum;
* depending how the instance if {@link #PMVMatrix(boolean) being constructed}.
*
*
- * Note:
- *
+ * Note:
+ *
*
The matrix is a {@link Buffers#slice2Float(Buffer, float[], int, int) sliced part } of a host matrix and it's start position has been {@link FloatBuffer#mark() marked}.
*
Use {@link FloatBuffer#reset() reset()} to rewind it to it's start position after relative operations, like {@link FloatBuffer#get() get()}.
- *
If using absolute operations like {@link FloatBuffer#get(int) get(int)}, use it's {@link FloatBuffer#reset() reset} {@link FloatBuffer#position() position} as it's offset.
+ *
If using absolute operations like {@link FloatBuffer#get(int) get(int)}, use it's {@link FloatBuffer#reset() reset} {@link FloatBuffer#position() position} as it's offset.
*
*
*/
@@ -96,20 +96,20 @@ public class PMVMatrix implements GLMatrixFunc {
public static final int MODIFIED_TEXTURE = 1 << 2;
/** Bit value stating all is modified */
public static final int MODIFIED_ALL = MODIFIED_PROJECTION | MODIFIED_MODELVIEW | MODIFIED_TEXTURE ;
-
+
/** Bit value stating a dirty {@link #glGetMviMatrixf() inverse modelview matrix (Mvi)}. */
public static final int DIRTY_INVERSE_MODELVIEW = 1 << 0;
/** Bit value stating a dirty {@link #glGetMvitMatrixf() inverse transposed modelview matrix (Mvit)}. */
- public static final int DIRTY_INVERSE_TRANSPOSED_MODELVIEW = 1 << 1;
+ public static final int DIRTY_INVERSE_TRANSPOSED_MODELVIEW = 1 << 1;
/** Bit value stating a dirty {@link #glGetFrustum() frustum}. */
- public static final int DIRTY_FRUSTUM = 1 << 2;
+ public static final int DIRTY_FRUSTUM = 1 << 2;
/** Bit value stating all is dirty */
public static final int DIRTY_ALL = DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM;
-
+
/**
- * @param matrixModeName One of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
+ * @param matrixModeName One of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
* @return true if the given matrix-mode name is valid, otherwise false.
- */
+ */
public static final boolean isMatrixModeName(final int matrixModeName) {
switch(matrixModeName) {
case GL_MODELVIEW_MATRIX:
@@ -121,9 +121,9 @@ public class PMVMatrix implements GLMatrixFunc {
}
/**
- * @param matrixModeName One of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
+ * @param matrixModeName One of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
* @return The corresponding matrix-get name, one of {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX}
- */
+ */
public static final int matrixModeName2MatrixGetName(final int matrixModeName) {
switch(matrixModeName) {
case GL_MODELVIEW:
@@ -138,9 +138,9 @@ public class PMVMatrix implements GLMatrixFunc {
}
/**
- * @param matrixGetName One of {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX}
+ * @param matrixGetName One of {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX}
* @return true if the given matrix-get name is valid, otherwise false.
- */
+ */
public static final boolean isMatrixGetName(final int matrixGetName) {
switch(matrixGetName) {
case GL_MATRIX_MODE:
@@ -155,7 +155,7 @@ public class PMVMatrix implements GLMatrixFunc {
/**
* @param matrixGetName One of {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX}
* @return The corresponding matrix-mode name, one of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
- */
+ */
public static final int matrixGetName2MatrixModeName(final int matrixGetName) {
switch(matrixGetName) {
case GL_MODELVIEW_MATRIX:
@@ -168,18 +168,18 @@ public class PMVMatrix implements GLMatrixFunc {
throw new GLException("unsupported matrixGetName: "+matrixGetName);
}
}
-
- /**
+
+ /**
* @param sb optional passed StringBuilder instance to be used
* @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
* @param a 4x4 matrix in column major order (OpenGL)
* @return matrix string representation
*/
public static StringBuilder matrixToString(StringBuilder sb, String f, FloatBuffer a) {
- return FloatUtil.matrixToString(sb, null, f, a, 0, 4, 4, false);
+ return FloatUtil.matrixToString(sb, null, f, a, 0, 4, 4, false);
}
-
- /**
+
+ /**
* @param sb optional passed StringBuilder instance to be used
* @param f the format string of one floating point, i.e. "%10.5f", see {@link java.util.Formatter}
* @param a 4x4 matrix in column major order (OpenGL)
@@ -187,33 +187,33 @@ public class PMVMatrix implements GLMatrixFunc {
* @return side by side representation
*/
public static StringBuilder matrixToString(StringBuilder sb, String f, FloatBuffer a, FloatBuffer b) {
- return FloatUtil.matrixToString(sb, null, f, a, 0, b, 0, 4, 4, false);
+ return FloatUtil.matrixToString(sb, null, f, a, 0, b, 0, 4, 4, false);
}
-
+
/**
* Creates an instance of PMVMatrix {@link #PMVMatrix(boolean) PMVMatrix(boolean useBackingArray)},
- * with useBackingArray = true.
+ * with useBackingArray = true.
*/
public PMVMatrix() {
this(true);
}
-
+
/**
* Creates an instance of PMVMatrix.
- *
+ *
* @param useBackingArray true for non direct NIO Buffers with guaranteed backing array,
* which allows faster access in Java computation.
*
false for direct NIO buffers w/o a guaranteed backing array.
* In most Java implementations, direct NIO buffers have no backing array
- * and hence the Java computation will be throttled down by direct IO get/put
- * operations.
+ * and hence the Java computation will be throttled down by direct IO get/put
+ * operations.
*
Depending on the application, ie. whether the Java computation or
- * JNI invocation and hence native data transfer part is heavier,
+ * JNI invocation and hence native data transfer part is heavier,
* this flag shall be set to true or false
.
*/
public PMVMatrix(boolean useBackingArray) {
this.usesBackingArray = useBackingArray;
-
+
// I Identity
// T Texture
// P Projection
@@ -228,24 +228,24 @@ public class PMVMatrix implements GLMatrixFunc {
matrixBuffer = Buffers.newDirectByteBuffer( ( 6*16 + ProjectFloat.getRequiredFloatBufferSize() ) * Buffers.SIZEOF_FLOAT );
matrixBuffer.mark();
}
-
+
matrixIdent = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 0*16, 1*16); // I
matrixTex = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 1*16, 1*16); // T
- matrixPMvMvit = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 2*16, 4*16); // P + Mv + Mvi + Mvit
+ matrixPMvMvit = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 2*16, 4*16); // P + Mv + Mvi + Mvit
matrixPMvMvi = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 2*16, 3*16); // P + Mv + Mvi
matrixPMv = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 2*16, 2*16); // P + Mv
matrixP = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 2*16, 1*16); // P
matrixMv = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 3*16, 1*16); // Mv
matrixMvi = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 4*16, 1*16); // Mvi
matrixMvit = Buffers.slice2Float(matrixBuffer, matrixBufferArray, 5*16, 1*16); // Mvit
-
+
projectFloat = new ProjectFloat(matrixBuffer, matrixBufferArray, 6*16);
-
+
if(null != matrixBuffer) {
matrixBuffer.reset();
- }
+ }
FloatUtil.makeIdentityf(matrixIdent);
-
+
vec3f = new float[3];
matrixMult = new float[16];
matrixTrans = new float[16];
@@ -263,7 +263,7 @@ public class PMVMatrix implements GLMatrixFunc {
matrixTStack = new FloatStack( 0, 2*16); // growSize: GL-min size (2)
matrixPStack = new FloatStack( 0, 2*16); // growSize: GL-min size (2)
matrixMvStack= new FloatStack( 0, 16*16); // growSize: half GL-min size (32)
-
+
// default values and mode
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@ -275,22 +275,22 @@ public class PMVMatrix implements GLMatrixFunc {
dirtyBits = DIRTY_ALL;
requestMask = 0;
matrixMode = GL_MODELVIEW;
-
+
mulPMV = null;
frustum = null;
}
/** @see #PMVMatrix(boolean) */
- public final boolean usesBackingArray() { return usesBackingArray; }
-
+ public final boolean usesBackingArray() { return usesBackingArray; }
+
public final void destroy() {
if(null!=projectFloat) {
projectFloat.destroy(); projectFloat=null;
}
matrixBuffer=null;
- matrixBuffer=null; matrixPMvMvit=null; matrixPMvMvi=null; matrixPMv=null;
- matrixP=null; matrixTex=null; matrixMv=null; matrixMvi=null; matrixMvit=null;
+ matrixBuffer=null; matrixPMvMvit=null; matrixPMvMvi=null; matrixPMv=null;
+ matrixP=null; matrixTex=null; matrixMv=null; matrixMvi=null; matrixMvit=null;
vec3f = null;
matrixMult = null;
@@ -299,7 +299,7 @@ public class PMVMatrix implements GLMatrixFunc {
matrixScale = null;
matrixOrtho = null;
matrixFrustum = null;
-
+
if(null!=matrixPStack) {
matrixPStack=null;
}
@@ -314,13 +314,13 @@ public class PMVMatrix implements GLMatrixFunc {
}
}
-
+
/** Returns the current matrix-mode, one of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}. */
public final int glGetMatrixMode() {
return matrixMode;
}
- /**
+ /**
* Returns the {@link GLMatrixFunc#GL_TEXTURE_MATRIX texture matrix} (T).
*
* See matrix storage details.
@@ -330,7 +330,7 @@ public class PMVMatrix implements GLMatrixFunc {
return matrixTex;
}
- /**
+ /**
* Returns the {@link GLMatrixFunc#GL_PROJECTION_MATRIX projection matrix} (P).
*
* See matrix storage details.
@@ -340,7 +340,7 @@ public class PMVMatrix implements GLMatrixFunc {
return matrixP;
}
- /**
+ /**
* Returns the {@link GLMatrixFunc#GL_MODELVIEW_MATRIX modelview matrix} (Mv).
*
* See matrix storage details.
@@ -350,7 +350,7 @@ public class PMVMatrix implements GLMatrixFunc {
return matrixMv;
}
- /**
+ /**
* Returns the inverse {@link GLMatrixFunc#GL_MODELVIEW_MATRIX modelview matrix} (Mvi).
*
* Method enables the Mvi matrix update, and performs it's update w/o clearing the modified bits.
@@ -367,7 +367,7 @@ public class PMVMatrix implements GLMatrixFunc {
return matrixMvi;
}
- /**
+ /**
* Returns the inverse transposed {@link GLMatrixFunc#GL_MODELVIEW_MATRIX modelview matrix} (Mvit).
*
* Method enables the Mvit matrix update, and performs it's update w/o clearing the modified bits.
@@ -383,9 +383,9 @@ public class PMVMatrix implements GLMatrixFunc {
updateImpl(false);
return matrixMvit;
}
-
- /**
- * Returns 2 matrices within one FloatBuffer: {@link #glGetPMatrixf() P} and {@link #glGetMvMatrixf() Mv}.
+
+ /**
+ * Returns 2 matrices within one FloatBuffer: {@link #glGetPMatrixf() P} and {@link #glGetMvMatrixf() Mv}.
*
@@ -393,9 +393,9 @@ public class PMVMatrix implements GLMatrixFunc {
public final FloatBuffer glGetPMvMatrixf() {
return matrixPMv;
}
-
- /**
- * Returns 3 matrices within one FloatBuffer: {@link #glGetPMatrixf() P}, {@link #glGetMvMatrixf() Mv} and {@link #glGetMviMatrixf() Mvi}.
+
+ /**
+ * Returns 3 matrices within one FloatBuffer: {@link #glGetPMatrixf() P}, {@link #glGetMvMatrixf() Mv} and {@link #glGetMviMatrixf() Mvi}.
*
* Method enables the Mvi matrix update, and performs it's update w/o clearing the modified bits.
*
@@ -410,9 +410,9 @@ public class PMVMatrix implements GLMatrixFunc {
updateImpl(false);
return matrixPMvMvi;
}
-
- /**
- * Returns 4 matrices within one FloatBuffer: {@link #glGetPMatrixf() P}, {@link #glGetMvMatrixf() Mv}, {@link #glGetMviMatrixf() Mvi} and {@link #glGetMvitMatrixf() Mvit}.
+
+ /**
+ * Returns 4 matrices within one FloatBuffer: {@link #glGetPMatrixf() P}, {@link #glGetMvMatrixf() Mv}, {@link #glGetMviMatrixf() Mvi} and {@link #glGetMvitMatrixf() Mvit}.
*
* Method enables the Mvi and Mvit matrix update, and performs it's update w/o clearing the modified bits.
*
@@ -427,14 +427,14 @@ public class PMVMatrix implements GLMatrixFunc {
updateImpl(false);
return matrixPMvMvit;
}
-
+
/** Returns the frustum, derived from projection * modelview */
public Frustum glGetFrustum() {
requestMask |= DIRTY_FRUSTUM;
updateImpl(false);
return frustum;
}
-
+
/*
* @return the matrix of the current matrix-mode
*/
@@ -443,7 +443,7 @@ public class PMVMatrix implements GLMatrixFunc {
}
/**
- * @param matrixName Either a matrix-get-name, i.e.
+ * @param matrixName Either a matrix-get-name, i.e.
* {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX},
* or a matrix-mode-name, i.e.
* {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
@@ -462,10 +462,10 @@ public class PMVMatrix implements GLMatrixFunc {
return matrixTex;
default:
throw new GLException("unsupported matrixName: "+matrixName);
- }
+ }
}
- //
+ //
// GLMatrixFunc implementation
//
@@ -494,7 +494,7 @@ public class PMVMatrix implements GLMatrixFunc {
}
params.position(pos);
}
-
+
@Override
public final void glGetFloatv(int matrixGetName, float[] params, int params_offset) {
if(matrixGetName==GL_MATRIX_MODE) {
@@ -505,7 +505,7 @@ public class PMVMatrix implements GLMatrixFunc {
matrix.reset();
}
}
-
+
@Override
public final void glGetIntegerv(int pname, IntBuffer params) {
int pos = params.position();
@@ -516,7 +516,7 @@ public class PMVMatrix implements GLMatrixFunc {
}
params.position(pos);
}
-
+
@Override
public final void glGetIntegerv(int pname, int[] params, int params_offset) {
if(pname==GL_MATRIX_MODE) {
@@ -537,12 +537,12 @@ public class PMVMatrix implements GLMatrixFunc {
matrixP.put(values, offset, 16);
matrixP.reset();
dirtyBits |= DIRTY_FRUSTUM ;
- modifiedBits |= MODIFIED_PROJECTION;
+ modifiedBits |= MODIFIED_PROJECTION;
} else if(matrixMode==GL.GL_TEXTURE) {
matrixTex.put(values, offset, 16);
matrixTex.reset();
modifiedBits |= MODIFIED_TEXTURE;
- }
+ }
}
@Override
@@ -557,12 +557,12 @@ public class PMVMatrix implements GLMatrixFunc {
matrixP.put(m);
matrixP.reset();
dirtyBits |= DIRTY_FRUSTUM ;
- modifiedBits |= MODIFIED_PROJECTION;
+ modifiedBits |= MODIFIED_PROJECTION;
} else if(matrixMode==GL.GL_TEXTURE) {
matrixTex.put(m);
matrixTex.reset();
modifiedBits |= MODIFIED_TEXTURE;
- }
+ }
m.position(spos);
}
@@ -584,9 +584,9 @@ public class PMVMatrix implements GLMatrixFunc {
@Override
public final void glPushMatrix() {
- if(matrixMode==GL_MODELVIEW) {
+ if(matrixMode==GL_MODELVIEW) {
matrixMvStack.putOnTop(matrixMv, 16);
- matrixMv.reset();
+ matrixMv.reset();
} else if(matrixMode==GL_PROJECTION) {
matrixPStack.putOnTop(matrixP, 16);
matrixP.reset();
@@ -612,8 +612,8 @@ public class PMVMatrix implements GLMatrixFunc {
matrixTex.put(matrixIdent);
matrixTex.reset();
modifiedBits |= MODIFIED_TEXTURE;
- }
- matrixIdent.reset();
+ }
+ matrixIdent.reset();
}
@Override
@@ -629,7 +629,7 @@ public class PMVMatrix implements GLMatrixFunc {
} else if(matrixMode==GL.GL_TEXTURE) {
FloatUtil.multMatrixf(matrixTex, m);
modifiedBits |= MODIFIED_TEXTURE;
- }
+ }
}
@Override
@@ -645,12 +645,12 @@ public class PMVMatrix implements GLMatrixFunc {
} else if(matrixMode==GL.GL_TEXTURE) {
FloatUtil.multMatrixf(matrixTex, m, m_offset);
modifiedBits |= MODIFIED_TEXTURE;
- }
+ }
}
@Override
public final void glTranslatef(final float x, final float y, final float z) {
- // Translation matrix:
+ // Translation matrix:
// 1 0 0 x
// 0 1 0 y
// 0 0 1 z
@@ -665,7 +665,7 @@ public class PMVMatrix implements GLMatrixFunc {
public final void glRotatef(final float angdeg, float x, float y, float z) {
final float angrad = angdeg * (float) Math.PI / 180.0f;
final float c = (float)Math.cos(angrad);
- final float ic= 1.0f - c;
+ final float ic= 1.0f - c;
final float s = (float)Math.sin(angrad);
vec3f[0]=x; vec3f[1]=y; vec3f[2]=z;
@@ -700,7 +700,7 @@ public class PMVMatrix implements GLMatrixFunc {
@Override
public final void glScalef(final float x, final float y, final float z) {
- // Scale matrix:
+ // Scale matrix:
// x 0 0 0
// 0 y 0 0
// 0 0 z 0
@@ -714,7 +714,7 @@ public class PMVMatrix implements GLMatrixFunc {
@Override
public final void glOrthof(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
- // Ortho matrix:
+ // Ortho matrix:
// 2/dx 0 0 tx
// 0 2/dy 0 ty
// 0 0 2/dz tz
@@ -744,7 +744,7 @@ public class PMVMatrix implements GLMatrixFunc {
if(left==right || top==bottom) {
throw new GLException("GL_INVALID_VALUE: top,bottom and left,right must not be equal");
}
- // Frustum matrix:
+ // Frustum matrix:
// 2*zNear/dx 0 A 0
// 0 2*zNear/dy B 0
// 0 0 C D
@@ -774,7 +774,7 @@ public class PMVMatrix implements GLMatrixFunc {
//
// Extra functionality
//
-
+
/**
* {@link #glMultMatrixf(FloatBuffer) Multiply} the {@link #glGetMatrixMode() current matrix} with the perspective/frustum matrix.
*/
@@ -787,7 +787,7 @@ public class PMVMatrix implements GLMatrixFunc {
}
/**
- * {@link #glMultMatrixf(FloatBuffer) Multiply} and {@link #glTranslatef(float, float, float) translate} the {@link #glGetMatrixMode() current matrix}
+ * {@link #glMultMatrixf(FloatBuffer) Multiply} and {@link #glTranslatef(float, float, float) translate} the {@link #glGetMatrixMode() current matrix}
* with the eye, object and orientation.
*/
public final void gluLookAt(float eyex, float eyey, float eyez,
@@ -798,7 +798,7 @@ public class PMVMatrix implements GLMatrixFunc {
/**
* Map object coordinates to window coordinates.
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -815,20 +815,20 @@ public class PMVMatrix implements GLMatrixFunc {
return projectFloat.gluProject(objx, objy, objz,
matrixMv.array(), matrixMv.position(),
matrixP.array(), matrixP.position(),
- viewport, viewport_offset,
+ viewport, viewport_offset,
win_pos, win_pos_offset);
} else {
return projectFloat.gluProject(objx, objy, objz,
matrixMv,
matrixP,
- viewport, viewport_offset,
+ viewport, viewport_offset,
win_pos, win_pos_offset);
}
}
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -845,23 +845,23 @@ public class PMVMatrix implements GLMatrixFunc {
return projectFloat.gluUnProject(winx, winy, winz,
matrixMv.array(), matrixMv.position(),
matrixP.array(), matrixP.position(),
- viewport, viewport_offset,
+ viewport, viewport_offset,
obj_pos, obj_pos_offset);
} else {
return projectFloat.gluUnProject(winx, winy, winz,
matrixMv,
matrixP,
- viewport, viewport_offset,
+ viewport, viewport_offset,
obj_pos, obj_pos_offset);
- }
+ }
}
-
+
public final void gluPickMatrix(float x, float y,
float deltaX, float deltaY,
int[] viewport, int viewport_offset) {
projectFloat.gluPickMatrix(this, x, y, deltaX, deltaY, viewport, viewport_offset);
}
-
+
public StringBuilder toString(StringBuilder sb, String f) {
if(null == sb) {
sb = new StringBuilder();
@@ -874,8 +874,8 @@ public class PMVMatrix implements GLMatrixFunc {
final boolean frustumReq = 0 != (DIRTY_FRUSTUM & requestMask);
final boolean modP = 0 != ( MODIFIED_PROJECTION & modifiedBits );
final boolean modMv = 0 != ( MODIFIED_MODELVIEW & modifiedBits );
- final boolean modT = 0 != ( MODIFIED_TEXTURE & modifiedBits );
-
+ final boolean modT = 0 != ( MODIFIED_TEXTURE & modifiedBits );
+
sb.append("PMVMatrix[backingArray ").append(this.usesBackingArray());
sb.append(", modified[P ").append(modP).append(", Mv ").append(modMv).append(", T ").append(modT);
sb.append("], dirty/req[Mvi ").append(mviDirty).append("/").append(mviReq).append(", Mvit ").append(mvitDirty).append("/").append(mvitReq).append(", Frustum ").append(frustumDirty).append("/").append(frustumReq);
@@ -887,28 +887,28 @@ public class PMVMatrix implements GLMatrixFunc {
matrixToString(sb, f, matrixTex);
if( 0 != ( requestMask & DIRTY_INVERSE_MODELVIEW ) ) {
sb.append(", Inverse Modelview").append(Platform.NEWLINE);
- matrixToString(sb, f, matrixMvi);
+ matrixToString(sb, f, matrixMvi);
}
if( 0 != ( requestMask & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) {
sb.append(", Inverse Transposed Modelview").append(Platform.NEWLINE);
- matrixToString(sb, f, matrixMvit);
+ matrixToString(sb, f, matrixMvit);
}
sb.append("]");
return sb;
}
-
+
public String toString() {
return toString(null, "%10.5f").toString();
}
- /**
+ /**
* Returns the modified bits due to mutable operations..
*
* A modified bit is set, if the corresponding matrix had been modified by a mutable operation
* since last {@link #update()} or {@link #getModifiedBits(boolean) getModifiedBits(true)} call.
*
* @param clear if true, clears the modified bits, otherwise leaves them untouched.
- *
+ *
* @see #MODIFIED_PROJECTION
* @see #MODIFIED_MODELVIEW
* @see #MODIFIED_TEXTURE
@@ -920,16 +920,16 @@ public class PMVMatrix implements GLMatrixFunc {
}
return r;
}
-
- /**
+
+ /**
* Returns the dirty bits due to mutable operations.
*
* A dirty bit is set , if the corresponding matrix had been modified by a mutable operation
* since last {@link #update()} call. The latter clears the dirty state only if the dirty matrix (Mvi or Mvit) or {@link Frustum}
- * has been requested by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
+ * has been requested by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
* or {@link #glGetFrustum() Frustum get} methods.
*
- *
+ *
* @deprecated Function is exposed for debugging purposes only.
* @see #DIRTY_INVERSE_MODELVIEW
* @see #DIRTY_INVERSE_TRANSPOSED_MODELVIEW
@@ -944,12 +944,12 @@ public class PMVMatrix implements GLMatrixFunc {
return dirtyBits;
}
- /**
+ /**
* Returns the request bit mask, which uses bit values equal to the dirty mask.
*
- * The request bit mask is set by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
+ * The request bit mask is set by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
* or {@link #glGetFrustum() Frustum get} methods.
- *
+ *
*
* @deprecated Function is exposed for debugging purposes only.
* @see #clearAllUpdateRequests()
@@ -965,16 +965,16 @@ public class PMVMatrix implements GLMatrixFunc {
public final int getRequestMask() {
return requestMask;
}
-
-
+
+
/**
* Clears all {@link #update()} requests of the Mvi and Mvit matrix and Frustum
- * after it has been enabled by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
+ * after it has been enabled by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
* or {@link #glGetFrustum() Frustum get} methods.
*
* Allows user to disable subsequent Mvi, Mvit and {@link Frustum} updates if no more required.
- *
- *
+ *
+ *
* @see #glGetMviMatrixf()
* @see #glGetMvitMatrixf()
* @see #glGetPMvMviMatrixf()
@@ -983,14 +983,14 @@ public class PMVMatrix implements GLMatrixFunc {
* @see #getRequestMask()
*/
public final void clearAllUpdateRequests() {
- requestMask &= ~DIRTY_ALL;
+ requestMask &= ~DIRTY_ALL;
}
-
+
/**
* Update the derived {@link #glGetMviMatrixf() inverse modelview (Mvi)},
- * {@link #glGetMvitMatrixf() inverse transposed modelview (Mvit)} matrices and {@link Frustum}
- * if they are dirty and they were requested
- * by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
+ * {@link #glGetMvitMatrixf() inverse transposed modelview (Mvit)} matrices and {@link Frustum}
+ * if they are dirty and they were requested
+ * by one of the {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
* or {@link #glGetFrustum() Frustum get} methods.
*
* The Mvi and Mvit matrices and {@link Frustum} are considered dirty, if their corresponding
@@ -999,7 +999,7 @@ public class PMVMatrix implements GLMatrixFunc {
*
* Method should be called manually in case mutable operations has been called
* and caller operates on already fetched references, i.e. not calling
- * {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
+ * {@link #glGetMviMatrixf() Mvi get}, {@link #glGetMvitMatrixf() Mvit get}
* or {@link #glGetFrustum() Frustum get} etc anymore.
*
*
@@ -1007,12 +1007,12 @@ public class PMVMatrix implements GLMatrixFunc {
* which are set by any mutable operation. The modified bits have no impact
* on this method, but the return value.
*
- *
- * @return true if any matrix has been modified since last update call or
+ *
+ * @return true if any matrix has been modified since last update call or
* if the derived matrices Mvi and Mvit or {@link Frustum} were updated, otherwise false.
* In other words, method returns true if any matrix used by the caller must be updated,
* e.g. uniforms in a shader program.
- *
+ *
* @see #getModifiedBits(boolean)
* @see #MODIFIED_PROJECTION
* @see #MODIFIED_MODELVIEW
@@ -1035,7 +1035,7 @@ public class PMVMatrix implements GLMatrixFunc {
if(clearModBits) {
modifiedBits = 0;
}
-
+
if( 0 != ( dirtyBits & ( DIRTY_FRUSTUM & requestMask ) ) ) {
if( null == frustum ) {
frustum = new Frustum();
@@ -1046,7 +1046,7 @@ public class PMVMatrix implements GLMatrixFunc {
dirtyBits &= ~DIRTY_FRUSTUM;
mod = true;
}
-
+
if( 0 == ( dirtyBits & requestMask ) ) {
return mod; // nothing more requested which may have been dirty
}
@@ -1061,9 +1061,9 @@ public class PMVMatrix implements GLMatrixFunc {
}
return setMviMvitNIODirectAccess() || mod;
}
-
+
//
- // private
+ // private
//
private int nioBackupArraySupported = 0; // -1 not supported, 0 - TBD, 1 - supported
private final String msgCantComputeInverse = "Invalid source Mv matrix, can't compute inverse";
@@ -1080,7 +1080,7 @@ public class PMVMatrix implements GLMatrixFunc {
res = true;
}
if( 0 != ( requestMask & ( dirtyBits & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) ) { // only if requested & dirty
- // transpose matrix
+ // transpose matrix
final float[] _matrixMvit = matrixMvit.array();
final int _matrixMvitOffset = matrixMvit.position();
for (int i = 0; i < 4; i++) {
@@ -1093,7 +1093,7 @@ public class PMVMatrix implements GLMatrixFunc {
}
return res;
}
-
+
private final boolean setMviMvitNIODirectAccess() {
boolean res = false;
if( 0 != ( dirtyBits & DIRTY_INVERSE_MODELVIEW ) ) { // only if dirt; always requested at this point, see update()
@@ -1104,7 +1104,7 @@ public class PMVMatrix implements GLMatrixFunc {
res = true;
}
if( 0 != ( requestMask & ( dirtyBits & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) ) { // only if requested & dirty
- // transpose matrix
+ // transpose matrix
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
matrixMvit.put(j+i*4, matrixMvi.get(i+j*4));
diff --git a/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
index a2b7ba343..b00866dd9 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.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.
@@ -35,14 +35,14 @@ import javax.media.opengl.GLException;
import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
/**
- * Variation of {@link TileRenderer} w/o using fixed tiles but arbitrary rectangular regions.
+ * Variation of {@link TileRenderer} w/o using fixed tiles but arbitrary rectangular regions.
*
* See {@link TileRendererBase} for details.
*
*/
public class RandomTileRenderer extends TileRendererBase {
private boolean tileRectSet = false;
-
+
/**
* Creates a new TileRenderer object
*/
@@ -72,15 +72,15 @@ public class RandomTileRenderer extends TileRendererBase {
/**
* Set the tile rectangle for the subsequent rendering calls.
- *
- * @throws IllegalArgumentException is tile x/y are < 0 or tile size is <= 0x0
+ *
+ * @throws IllegalArgumentException is tile x/y are < 0 or tile size is <= 0x0
*/
public void setTileRect(int tX, int tY, int tWidth, int tHeight) throws IllegalStateException, IllegalArgumentException {
if( 0 > tX || 0 > tX ) {
- throw new IllegalArgumentException("Tile pos must be >= 0/0");
+ throw new IllegalArgumentException("Tile pos must be >= 0/0");
}
if( 0 >= tWidth || 0 >= tHeight ) {
- throw new IllegalArgumentException("Tile size must be > 0x0");
+ throw new IllegalArgumentException("Tile size must be > 0x0");
}
this.currentTileXPos = tX;
this.currentTileYPos = tY;
@@ -88,57 +88,57 @@ public class RandomTileRenderer extends TileRendererBase {
this.currentTileHeight = tHeight;
tileRectSet = true;
}
-
+
@Override
public final boolean isSetup() {
return 0 < imageSize.getWidth() && 0 < imageSize.getHeight() && tileRectSet;
}
-
+
/**
* {@inheritDoc}
- *
- *
+ *
+ *
* end of tiling is never reached w/ {@link RandomRileRenderer},
* i.e. method always returns false.
*
*/
@Override
public final boolean eot() { return false; }
-
+
/**
* {@inheritDoc}
- *
+ *
* Reset internal states of {@link RandomTileRenderer} are: none.
*/
@Override
public final void reset() { }
-
+
/**
* {@inheritDoc}
- *
- * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or
+ *
+ * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or
* {@link #setTileRect(int, int, int, int) tile-rect} has not been set.
*/
@Override
public final void beginTile(GL gl) throws IllegalStateException, GLException {
if( 0 >= imageSize.getWidth() || 0 >= imageSize.getHeight() ) {
- throw new IllegalStateException("Image size has not been set");
+ throw new IllegalStateException("Image size has not been set");
}
if( !tileRectSet ) {
throw new IllegalStateException("tileRect has not been set");
}
validateGL(gl);
-
+
gl.glViewport( 0, 0, currentTileWidth, currentTileHeight );
-
+
if( DEBUG ) {
System.err.println("TileRenderer.begin.X: "+this.toString());
}
-
+
// Do not forget to issue:
// reshape( 0, 0, tW, tH );
// which shall reflect tile renderer fileds: currentTileXPos, currentTileYPos and imageSize
-
+
beginCalled = true;
}
@@ -148,7 +148,7 @@ public class RandomTileRenderer extends TileRendererBase {
throw new IllegalStateException("beginTile(..) has not been called");
}
validateGL(gl);
-
+
// be sure OpenGL rendering is finished
gl.glFlush();
@@ -220,13 +220,13 @@ public class RandomTileRenderer extends TileRendererBase {
/* restore previous glPixelStore values */
psm.restore(gl);
-
+
beginCalled = false;
}
-
+
/**
* Rendering one tile, by simply calling {@link GLAutoDrawable#display()}.
- *
+ *
* @throws IllegalStateException if no {@link GLAutoDrawable} is {@link #attachAutoDrawable(GLAutoDrawable) attached}
* or imageSize is not set
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
index b949f0e39..47d56bcb1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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,7 +28,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.
@@ -46,7 +46,7 @@ import java.nio.channels.*;
* class; can also be used in conjunction with the {@link com.jogamp.opengl.util.gl2.TileRenderer} class.
*/
public class TGAWriter {
-
+
private static final int TARGA_HEADER_SIZE = 18;
private FileChannel ch;
@@ -91,7 +91,7 @@ public class TGAWriter {
image.put(14, (byte) (height & 0xFF)); // height
image.put(15, (byte) (height >> 8)); // height
image.put(16, (byte) pixelSize); // pixel size
-
+
// go to image data position
image.position(TARGA_HEADER_SIZE);
// jogl needs a sliced buffer
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
index 999db77a9..7f86b14c6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.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,18 +20,18 @@
* 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.
- *
+ *
* ---------------------
- *
+ *
* Based on Brian Paul's tile rendering library, found
* at http://www.mesa3d.org/brianp/TR.html.
- *
- * Copyright (C) 1997-2005 Brian Paul.
- * Licensed under BSD-compatible terms with permission of the author.
+ *
+ * Copyright (C) 1997-2005 Brian Paul.
+ * Licensed under BSD-compatible terms with permission of the author.
* See LICENSE.txt for license information.
*/
package com.jogamp.opengl.util;
@@ -60,7 +60,7 @@ import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
*
* See {@link TileRendererBase} for details.
*
- *
+ *
* @author ryanm, sgothel
*/
public class TileRenderer extends TileRendererBase {
@@ -150,7 +150,7 @@ public class TileRenderer extends TileRendererBase {
.append("rowOrder "+rowOrder+", offset/size "+offsetX+"/"+offsetY+" "+tileSize.getWidth()+"x"+tileSize.getHeight()+" brd "+tileBorder+", ");
return super.tileDetails(sb);
}
-
+
/**
* Creates a new TileRenderer object
*/
@@ -169,7 +169,7 @@ public class TileRenderer extends TileRendererBase {
super.setImageSize(width, height);
reset();
}
-
+
/**
* Clips the image-size this tile-renderer iterates through,
* which can be retrieved via {@link #getClippedImageSize()}.
@@ -179,7 +179,7 @@ public class TileRenderer extends TileRendererBase {
*
* Implementation {@link #reset()} internal states.
*
- *
+ *
* @param width The image-clipping.width
* @param height The image-clipping.height
* @see #getClippedImageSize()
@@ -208,7 +208,7 @@ public class TileRenderer extends TileRendererBase {
* {@link #TR_IMAGE_CLIPPING_HEIGHT}.
*
*/
- public final DimensionImmutable getClippedImageSize() {
+ public final DimensionImmutable getClippedImageSize() {
if( null != imageClippingDim ) {
return new Dimension(Math.min(imageClippingDim.getWidth(), imageSize.getWidth()),
Math.min(imageClippingDim.getHeight(), imageSize.getHeight()) );
@@ -224,7 +224,7 @@ public class TileRenderer extends TileRendererBase {
*
* Implementation {@link #reset()} internal states.
*
- *
+ *
* @param width
* The width of the tiles. Must not be larger than the GL
* context
@@ -238,10 +238,10 @@ public class TileRenderer extends TileRendererBase {
*/
public final void setTileSize(int width, int height, int border) {
if( 0 > border ) {
- throw new IllegalArgumentException("Tile border must be >= 0");
+ throw new IllegalArgumentException("Tile border must be >= 0");
}
if( 2 * border >= width || 2 * border >= height ) {
- throw new IllegalArgumentException("Tile size must be > 0x0 minus 2*border");
+ throw new IllegalArgumentException("Tile size must be > 0x0 minus 2*border");
}
tileBorder = border;
tileSize.set( width, height );
@@ -249,7 +249,7 @@ public class TileRenderer extends TileRendererBase {
reset();
}
- /**
+ /**
* Sets an xy offset for the resulting tiles
* {@link TileRendererBase#TR_CURRENT_TILE_X_POS x-pos} and {@link TileRendererBase#TR_CURRENT_TILE_Y_POS y-pos}.
* @see #TR_TILE_X_OFFSET
@@ -259,12 +259,12 @@ public class TileRenderer extends TileRendererBase {
offsetX = xoff;
offsetY = yoff;
}
-
+
/**
* {@inheritDoc}
- *
+ *
* Reset internal states of {@link TileRenderer} are:
- *
+ *
*
{@link #TR_ROWS}
*
{@link #TR_COLUMNS}
*
{@link #TR_CURRENT_COLUMN}
@@ -291,13 +291,13 @@ public class TileRenderer extends TileRendererBase {
assert columns >= 0;
assert rows >= 0;
-
+
beginCalled = false;
isInit = true;
}
/* pp */ final int getCurrentTile() { return currentTile; }
-
+
@Override
public final int getParam(int pname) {
switch (pname) {
@@ -346,7 +346,7 @@ public class TileRenderer extends TileRendererBase {
/**
* Sets the order of row traversal, default is {@link #TR_BOTTOM_TO_TOP}.
- *
+ *
* @param order The row traversal order, must be either {@link #TR_TOP_TO_BOTTOM} or {@link #TR_BOTTOM_TO_TOP}.
*/
public final void setRowOrder(int order) {
@@ -361,11 +361,11 @@ public class TileRenderer extends TileRendererBase {
public final boolean isSetup() {
return 0 < imageSize.getWidth() && 0 < imageSize.getHeight();
}
-
+
/**
* {@inheritDoc}
- *
- *
+ *
+ *
* end of tiling is reached w/ {@link TileRenderer}, if at least one of the following is true:
*
*
all tiles have been rendered, i.e. {@link #TR_CURRENT_TILE_NUM} is -1
@@ -378,13 +378,13 @@ public class TileRenderer extends TileRendererBase {
if ( !isInit ) { // ensure at least one reset-call
reset();
}
- return 0 > currentTile || 0 >= columns*rows;
+ return 0 > currentTile || 0 >= columns*rows;
}
-
+
/**
* {@inheritDoc}
- *
- * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or
+ *
+ * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or
* {@link #eot() end-of-tiling} has been reached.
*/
@Override
@@ -396,7 +396,7 @@ public class TileRenderer extends TileRendererBase {
throw new IllegalStateException("EOT reached: "+this);
}
validateGL(gl);
-
+
/* which tile (by row and column) we're about to render */
if (rowOrder == TR_BOTTOM_TO_TOP) {
currentRow = currentTile / columns;
@@ -434,11 +434,11 @@ public class TileRenderer extends TileRendererBase {
currentTileHeight = tH;
gl.glViewport( 0, 0, tW, tH );
-
+
if( DEBUG ) {
System.err.println("TileRenderer.begin: "+this.toString());
}
-
+
// Do not forget to issue:
// reshape( 0, 0, tW, tH );
// which shall reflect tile renderer tiles: currentTileXPos, currentTileYPos and imageSize
@@ -454,7 +454,7 @@ public class TileRenderer extends TileRendererBase {
// be sure OpenGL rendering is finished
gl.glFlush();
-
+
// save current glPixelStore values
psm.save(gl);
psm.setPackAlignment(gl, 1);
@@ -467,13 +467,13 @@ public class TileRenderer extends TileRendererBase {
} else {
gl2es3 = null;
readBuffer = 0; // undef. probably default: GL_FRONT (single buffering) GL_BACK (double buffering)
- }
+ }
if( DEBUG ) {
System.err.println("TileRenderer.end.0: readBuffer 0x"+Integer.toHexString(readBuffer)+", "+this.toString());
}
-
+
final int tmp[] = new int[1];
-
+
if( tileBuffer != null ) {
final GLPixelAttributes pixelAttribs = tileBuffer.pixelAttributes;
final int srcX = tileBorder;
@@ -527,7 +527,7 @@ public class TileRenderer extends TileRendererBase {
psm.restore(gl);
beginCalled = false;
-
+
/* increment tile counter, return 1 if more tiles left to render */
currentTile++;
if( currentTile >= rows * columns ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
index 0553d5673..ff7cc5516 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.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,18 +20,18 @@
* 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.
- *
+ *
* ---------------------
- *
+ *
* Based on Brian Paul's tile rendering library, found
* at http://www.mesa3d.org/brianp/TR.html.
- *
- * Copyright (C) 1997-2005 Brian Paul.
- * Licensed under BSD-compatible terms with permission of the author.
+ *
+ * Copyright (C) 1997-2005 Brian Paul.
+ * Licensed under BSD-compatible terms with permission of the author.
* See LICENSE.txt for license information.
*/
package com.jogamp.opengl.util;
@@ -66,17 +66,17 @@ import jogamp.opengl.Debug;
* The PMV matrix needs to be reshaped in user code
* after calling {@link #beginTile(GL)}, See {@link #beginTile(GL)}.
*
- *
+ *
* If {@link #attachAutoDrawable(GLAutoDrawable) attaching to} an {@link GLAutoDrawable},
* the {@link TileRendererListener#reshapeTile(TileRendererBase, int, int, int, int, int, int)} method
* is being called after {@link #beginTile(GL)} for each rendered tile.
- * It's implementation shall reshape the PMV matrix according to {@link #beginTile(GL)}.
+ * It's implementation shall reshape the PMV matrix according to {@link #beginTile(GL)}.
*
- * Note that {@link #setImageBuffer(GLPixelBuffer) image buffer} can only be used
+ * Note that {@link #setImageBuffer(GLPixelBuffer) image buffer} can only be used
* in conjunction w/ a {@link GL} instance ≥ {@link GL2ES3} passed to {@link #beginTile(GL)} and {@link #endTile(GL)}.
- * This is due to setting up the {@link GL2ES3#GL_PACK_ROW_LENGTH pack row length}
+ * This is due to setting up the {@link GL2ES3#GL_PACK_ROW_LENGTH pack row length}
* for an {@link #setImageSize(int, int) image width} != tile-width, which usually is the case.
* Hence a {@link GLException} is thrown in both methods,
* if using an {@link #setImageBuffer(GLPixelBuffer) image buffer}
@@ -86,7 +86,7 @@ import jogamp.opengl.Debug;
* Further more, reading back of MSAA buffers is only supported since {@link GL2ES3}
* since it requires to set the {@link GL2ES3#glReadBuffer(int) read-buffer}.
*
- *
+ *
* @author ryanm, sgothel
*/
public abstract class TileRendererBase {
@@ -114,16 +114,16 @@ public abstract class TileRendererBase {
* The height of the current tile. See {@link #getParam(int)}.
*/
public static final int TR_CURRENT_TILE_HEIGHT = 6;
-
+
/* pp */ static final boolean DEBUG = Debug.debug("TileRenderer");
-
- /**
+
+ /**
* Listener for tile renderer events, intended to extend {@link GLEventListener} implementations,
* enabling tile rendering via {@link TileRendererBase#attachAutoDrawable(GLAutoDrawable)}.
*/
public static interface TileRendererListener {
- /**
- * The owning {@link GLAutoDrawable} is {@link TileRendererBase#attachAutoDrawable(GLAutoDrawable) attached}
+ /**
+ * The owning {@link GLAutoDrawable} is {@link TileRendererBase#attachAutoDrawable(GLAutoDrawable) attached}
* to the given {@link TileRendererBase} instance.
*
* The {@link GLContext} of the {@link TileRendererBase}'s {@link TileRendererBase#getAttachedDrawable() attached} {@link GLAutoDrawable}
@@ -133,9 +133,9 @@ public abstract class TileRendererBase {
* @see TileRendererBase#getAttachedDrawable()
*/
public void addTileRendererNotify(TileRendererBase tr);
-
- /**
- * The owning {@link GLAutoDrawable} is {@link TileRendererBase#detachAutoDrawable() detached}
+
+ /**
+ * The owning {@link GLAutoDrawable} is {@link TileRendererBase#detachAutoDrawable() detached}
* from the given {@link TileRendererBase} instance.
*
* The {@link GLContext} of the {@link TileRendererBase}'s {@link TileRendererBase#getAttachedDrawable() attached} {@link GLAutoDrawable}
@@ -145,10 +145,10 @@ public abstract class TileRendererBase {
* @see TileRendererBase#getAttachedDrawable()
*/
public void removeTileRendererNotify(TileRendererBase tr);
-
- /**
+
+ /**
* Called by the {@link TileRendererBase} during tile-rendering via an
- * {@link TileRendererBase#getAttachedDrawable() attached} {@link GLAutoDrawable}'s
+ * {@link TileRendererBase#getAttachedDrawable() attached} {@link GLAutoDrawable}'s
* {@link GLAutoDrawable#display()} call for each tile before {@link #display(GLAutoDrawable)}.
*
* The PMV Matrix shall be reshaped
@@ -175,14 +175,14 @@ public abstract class TileRendererBase {
* @see TileRendererBase#getAttachedDrawable()
*/
public void reshapeTile(TileRendererBase tr,
- int tileX, int tileY, int tileWidth, int tileHeight,
+ int tileX, int tileY, int tileWidth, int tileHeight,
int imageWidth, int imageHeight);
/**
- * Called by the {@link TileRendererBase} during tile-rendering
+ * Called by the {@link TileRendererBase} during tile-rendering
* after {@link TileRendererBase#beginTile(GL)} and before {@link #reshapeTile(TileRendererBase, int, int, int, int, int, int) reshapeTile(..)}.
*
- * If {@link TileRendererBase} is of type {@link TileRenderer},
+ * If {@link TileRendererBase} is of type {@link TileRenderer},
* method is called for the first tile of all tiles.
* Otherwise, i.e. {@link RandomTileRenderer}, method is called for each particular tile.
*
@@ -193,12 +193,12 @@ public abstract class TileRendererBase {
* @param tr the issuing {@link TileRendererBase}
*/
public void startTileRendering(TileRendererBase tr);
-
+
/**
* Called by the {@link TileRenderer} during tile-rendering
* after {@link TileRendererBase#endTile(GL)} and {@link GLAutoDrawable#swapBuffers()}.
*
- * If {@link TileRendererBase} is of type {@link TileRenderer},
+ * If {@link TileRendererBase} is of type {@link TileRenderer},
* method is called for the last tile of all tiles.
* Otherwise, i.e. {@link RandomTileRenderer}, method is called for each particular tile.
*
@@ -210,7 +210,7 @@ public abstract class TileRendererBase {
*/
public void endTileRendering(TileRendererBase tr);
}
-
+
protected final Dimension imageSize = new Dimension(0, 0);
protected final GLPixelStorageModes psm = new GLPixelStorageModes();
protected GLPixelBuffer imageBuffer;
@@ -249,24 +249,24 @@ public abstract class TileRendererBase {
return getClass().getSimpleName()+
"["+toString(sb).toString()+"]";
}
-
+
protected TileRendererBase() {
}
/**
* Gets the parameters of this TileRenderer object
- *
+ *
* @param pname The parameter name that is to be retrieved
* @return the value of the parameter
* @throws IllegalArgumentException if pname is not handled
*/
public abstract int getParam(int pname) throws IllegalArgumentException;
-
+
/**
* Specify a buffer the tiles to be copied to. This is not
* necessary for the creation of the final image, but useful if you
* want to inspect each tile in turn.
- *
+ *
* @param buffer The buffer itself. Must be large enough to contain a random tile
*/
public final void setTileBuffer(GLPixelBuffer buffer) {
@@ -281,7 +281,7 @@ public abstract class TileRendererBase {
/**
* Sets the desired size of the final image
- *
+ *
* @param width The width of the final image
* @param height The height of the final image
*/
@@ -294,7 +294,7 @@ public abstract class TileRendererBase {
/**
* Sets the buffer in which to store the final image
- *
+ *
* @param buffer the buffer itself, must be large enough to hold the final image
*/
public final void setImageBuffer(GLPixelBuffer buffer) {
@@ -310,16 +310,16 @@ public abstract class TileRendererBase {
/* pp */ final void validateGL(GL gl) throws GLException {
if( imageBuffer != null && !gl.isGL2ES3()) {
throw new GLException("Using image-buffer w/ inssufficient GL context: "+gl.getContext().getGLVersion()+", "+gl.getGLProfile());
- }
+ }
}
-
- /**
+
+ /**
* Returns true if this instance is setup properly, i.e. {@link #setImageSize(int, int)} ..,
* and ready for {@link #beginTile(GL)}.
* Otherwise returns false.
*/
public abstract boolean isSetup();
-
+
/**
* Returns true if end of tiling has been reached, otherwise false.
*
@@ -331,7 +331,7 @@ public abstract class TileRendererBase {
*
*/
public abstract boolean eot();
-
+
/**
* Method resets implementation's internal state to start of tiling
* as required for {@link #beginTile(GL)} if {@link #eot() end of tiling} has been reached.
@@ -340,7 +340,7 @@ public abstract class TileRendererBase {
*
*/
public abstract void reset();
-
+
/**
* Begins rendering a tile.
*
@@ -367,7 +367,7 @@ public abstract class TileRendererBase {
*
*
* Use shall render the scene afterwards, concluded with a call to
- * this renderer {@link #endTile(GL)}.
+ * this renderer {@link #endTile(GL)}.
*
*
* User has to comply with the GL profile requirement.
@@ -376,10 +376,10 @@ public abstract class TileRendererBase {
* If {@link #eot() end of tiling} has been reached,
* user needs to {@link #reset()} tiling before calling this method.
*
- *
+ *
* @param gl The gl context
* @throws IllegalStateException if {@link #setImageSize(int, int) image-size} is undefined,
- * an {@link #isSetup() implementation related setup} has not be performed
+ * an {@link #isSetup() implementation related setup} has not be performed
* or {@ link #eot()} has been reached. See implementing classes.
* @throws GLException if {@link #setImageBuffer(GLPixelBuffer) image buffer} is used but gl instance is < {@link GL2ES3}
* @see #isSetup()
@@ -387,7 +387,7 @@ public abstract class TileRendererBase {
* @see #reset()
*/
public abstract void beginTile(GL gl) throws IllegalStateException, GLException;
-
+
/**
* Must be called after rendering the scene,
* see {@link #beginTile(GL)}.
@@ -399,13 +399,13 @@ public abstract class TileRendererBase {
*
- *
+ *
* @param gl the gl context
* @throws IllegalStateException if beginTile(gl) has not been called
* @throws GLException if {@link #setImageBuffer(GLPixelBuffer) image buffer} is used but gl instance is < {@link GL2ES3}
*/
public abstract void endTile( GL gl ) throws IllegalStateException, GLException;
-
+
/**
* Determines whether the chosen {@link GLCapabilitiesImmutable}
* requires a pre-{@link GLDrawable#swapBuffers() swap-buffers}
@@ -417,18 +417,18 @@ public abstract class TileRendererBase {
* Here {@link GLDrawable#swapBuffers() swap-buffers} shall happen after calling {@link #endTile(GL)}, the default.
*
*
- * However, multisampling offscreen {@link GLFBODrawable}s
+ * However, multisampling offscreen {@link GLFBODrawable}s
* utilize {@link GLDrawable#swapBuffers() swap-buffers} to downsample
* the multisamples into the readable sampling sink.
- * In this case, we require a {@link GLDrawable#swapBuffers() swap-buffers} before calling {@link #endTile(GL)}.
- *
- * @param chosenCaps the chosen {@link GLCapabilitiesImmutable}
+ * In this case, we require a {@link GLDrawable#swapBuffers() swap-buffers} before calling {@link #endTile(GL)}.
+ *
+ * @param chosenCaps the chosen {@link GLCapabilitiesImmutable}
* @return chosenCaps.isFBO() && chosenCaps.getSampleBuffers()
*/
public final boolean reqPreSwapBuffers(GLCapabilitiesImmutable chosenCaps) {
return chosenCaps.isFBO() && chosenCaps.getSampleBuffers();
}
-
+
/**
* Attaches the given {@link GLAutoDrawable} to this tile renderer.
*
@@ -440,17 +440,17 @@ public abstract class TileRendererBase {
*
* The {@link GLAutoDrawable}'s {@link GLAutoDrawable#getAutoSwapBufferMode() auto-swap mode} is cached
* and set to false, since {@link GLAutoDrawable#swapBuffers() swapBuffers()} maybe issued before {@link #endTile(GL)},
- * see {@link #reqPreSwapBuffers(GLCapabilitiesImmutable)}.
+ * see {@link #reqPreSwapBuffers(GLCapabilitiesImmutable)}.
*
*
- * This tile renderer's internal {@link GLEventListener} is then added to the attached {@link GLAutoDrawable}
+ * This tile renderer's internal {@link GLEventListener} is then added to the attached {@link GLAutoDrawable}
* to handle the tile rendering, replacing the original {@link GLEventListener}.
* It's {@link GLEventListener#display(GLAutoDrawable) display} implementations issues:
*
@@ -468,7 +468,7 @@ public abstract class TileRendererBase {
* since it's called after {@link #endTile(GL)}.
*
*
- * Call {@link #detachAutoDrawable()} to remove the attached {@link GLAutoDrawable} from this tile renderer
+ * Call {@link #detachAutoDrawable()} to remove the attached {@link GLAutoDrawable} from this tile renderer
* and to restore it's original {@link GLEventListener}.
*
* @param glad the {@link GLAutoDrawable} to attach.
@@ -481,7 +481,7 @@ public abstract class TileRendererBase {
throw new IllegalStateException("GLAutoDrawable already attached");
}
this.glad = glad;
-
+
final int aSz = glad.getGLEventListenerCount();
listeners = new GLEventListener[aSz];
listenersInit = new boolean[aSz];
@@ -510,11 +510,11 @@ public abstract class TileRendererBase {
}
}
- /**
- * Returns a previously {@link #attachAutoDrawable(GLAutoDrawable) attached} {@link GLAutoDrawable},
+ /**
+ * Returns a previously {@link #attachAutoDrawable(GLAutoDrawable) attached} {@link GLAutoDrawable},
* null if none is attached.
*
- * If called from {@link TileRendererListener#addTileRendererNotify(TileRendererBase)}
+ * If called from {@link TileRendererListener#addTileRendererNotify(TileRendererBase)}
* or {@link TileRendererListener#removeTileRendererNotify(TileRendererBase)}, method returns the
* just attached or soon to be detached {@link GLAutoDrawable}.
*
@@ -522,9 +522,9 @@ public abstract class TileRendererBase {
* @see #detachAutoDrawable()
*/
public final GLAutoDrawable getAttachedDrawable() {
- return glad;
+ return glad;
}
-
+
/**
* Detaches the given {@link GLAutoDrawable} from this tile renderer.
* @see #attachAutoDrawable(GLAutoDrawable)
@@ -547,16 +547,16 @@ public abstract class TileRendererBase {
System.err.println("TileRenderer: detached: "+glad);
System.err.println("TileRenderer: "+glad.getChosenGLCapabilities());
}
-
+
listeners = null;
listenersInit = null;
glad = null;
}
}
-
+
/**
* Set {@link GLEventListener} for pre- and post operations when used w/
- * {@link #attachAutoDrawable(GLAutoDrawable)}
+ * {@link #attachAutoDrawable(GLAutoDrawable)}
* for each {@link GLEventListener} callback.
* @param preTile the pre operations
* @param postTile the post operations
@@ -565,10 +565,10 @@ public abstract class TileRendererBase {
glEventListenerPre = preTile;
glEventListenerPost = postTile;
}
-
+
/**
* Rendering one tile, by simply calling {@link GLAutoDrawable#display()}.
- *
+ *
* @throws IllegalStateException if no {@link GLAutoDrawable} is {@link #attachAutoDrawable(GLAutoDrawable) attached}
* or imageSize is not set
*/
@@ -578,10 +578,10 @@ public abstract class TileRendererBase {
}
glad.display();
}
-
+
private final GLEventListener tiledGLEL = new GLEventListener() {
final TileRenderer tileRenderer = TileRendererBase.this instanceof TileRenderer ? (TileRenderer) TileRendererBase.this : null;
-
+
@Override
public void init(GLAutoDrawable drawable) {
if( null != glEventListenerPre ) {
@@ -642,13 +642,13 @@ public abstract class TileRendererBase {
if( null == tileRenderer || 0 == tileRenderer.getCurrentTile() ) {
tl.startTileRendering(TileRendererBase.this);
}
- tl.reshapeTile(TileRendererBase.this,
+ tl.reshapeTile(TileRendererBase.this,
currentTileXPos, currentTileYPos, currentTileWidth, currentTileHeight,
imageSize.getWidth(), imageSize.getHeight());
l.display(drawable);
}
}
-
+
if( gladRequiresPreSwap ) {
glad.swapBuffers();
endTile(gl);
@@ -662,7 +662,7 @@ public abstract class TileRendererBase {
if( l instanceof TileRendererListener ) {
((TileRendererListener)l).endTileRendering(TileRendererBase.this);
}
- }
+ }
}
if( null != glEventListenerPost ) {
glEventListenerPost.reshape(drawable, 0, 0, currentTileWidth, currentTileHeight);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
index e2bca010c..45f5d2694 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.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,51 +20,51 @@
* 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 com.jogamp.opengl.util;
-/**
+/**
* Integer time frame in milliseconds, maybe specialized for texture/video, audio, .. animated content.
*
* Type and value range has been chosen to suit embedded CPUs
* and characteristics of audio / video streaming and animations.
- * Milliseconds of type integer with a maximum value of {@link Integer#MAX_VALUE}
+ * Milliseconds of type integer with a maximum value of {@link Integer#MAX_VALUE}
* will allow tracking time up 2,147,483.647 seconds or
* 24 days 20 hours 31 minutes and 23 seconds.
*
*
* Milliseconds granularity is also more than enough to deal with A-V synchronization,
* where the threshold usually lies within 22ms.
- *
+ *
*
* Milliseconds granularity for displaying video frames might seem inaccurate
* for each single frame, i.e. 60Hz != 16ms, however, accumulated values diminish
- * this error and vertical sync is achieved by build-in V-Sync of the video drivers.
+ * this error and vertical sync is achieved by build-in V-Sync of the video drivers.
*
*/
public class TimeFrameI {
/** Constant marking an invalid PTS, i.e. Integer.MIN_VALUE == 0x80000000 == {@value}. Sync w/ native code. */
public static final int INVALID_PTS = 0x80000000;
-
+
/** Constant marking the end of the stream PTS, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == {@value}. Sync w/ native code. */
- public static final int END_OF_STREAM_PTS = 0x7FFFFFFF;
+ public static final int END_OF_STREAM_PTS = 0x7FFFFFFF;
protected int pts;
protected int duration;
-
+
public TimeFrameI() {
pts = INVALID_PTS;
- duration = 0;
+ duration = 0;
}
public TimeFrameI(int pts, int duration) {
this.pts = pts;
- this.duration = duration;
+ this.duration = duration;
}
-
+
/** Get this frame's presentation timestamp (PTS) in milliseconds. */
public final int getPTS() { return pts; }
/** Set this frame's presentation timestamp (PTS) in milliseconds. */
@@ -73,7 +73,7 @@ public class TimeFrameI {
public final int getDuration() { return duration; }
/** Set this frame's duration in milliseconds. */
public final void setDuration(int duration) { this.duration = duration; }
-
+
public String toString() {
return "TimeFrame[pts " + pts + " ms, l " + duration + " ms]";
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
index 8751fc816..dffdfae8e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.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.
@@ -35,10 +35,10 @@ import jogamp.opengl.Debug;
public interface AudioSink {
public static final boolean DEBUG = Debug.debug("AudioSink");
-
+
/** Default frame duration in millisecond, i.e. 1 frame per {@value} ms. */
public static final int DefaultFrameDuration = 32;
-
+
/** Initial audio queue size in milliseconds. {@value} ms, i.e. 16 frames per 32 ms. See {@link #init(AudioFormat, float, int, int, int)}.*/
public static final int DefaultInitialQueueSize = 16 * 32; // 512 ms
/** Audio queue grow size in milliseconds. {@value} ms, i.e. 16 frames per 32 ms. See {@link #init(AudioFormat, float, int, int, int)}.*/
@@ -47,7 +47,7 @@ public interface AudioSink {
public static final int DefaultQueueLimitWithVideo = 96 * 32; // 3072 ms
/** Audio queue limit w/o video in milliseconds. {@value} ms, i.e. 32 frames per 32 ms. See {@link #init(AudioFormat, float, int, int, int)}.*/
public static final int DefaultQueueLimitAudioOnly = 32 * 32; // 1024 ms
-
+
/**
* Specifies the linear audio PCM format.
*/
@@ -78,7 +78,7 @@ public interface AudioSink {
}
}
}
-
+
/** Sample rate in Hz (1/s). */
public final int sampleRate;
/** Sample size in bits. */
@@ -91,36 +91,36 @@ public interface AudioSink {
/** Planar or packed samples. If planar, each channel has their own data buffer. If packed, channel data is interleaved in one buffer. */
public final boolean planar;
public final boolean littleEndian;
-
-
+
+
//
// Time <-> Bytes
//
-
- /**
- * Returns the byte size of the given milliseconds
+
+ /**
+ * Returns the byte size of the given milliseconds
* according to {@link #sampleSize}, {@link #channelCount} and {@link #sampleRate}.
*
* Time -> Byte Count
- *
+ *
*/
public final int getDurationsByteSize(int millisecs) {
final int bytesPerSample = sampleSize >>> 3; // /8
return millisecs * ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
}
-
- /**
- * Returns the duration in milliseconds of the given byte count
- * according to {@link #sampleSize}, {@link #channelCount} and {@link #sampleRate}.
+
+ /**
+ * Returns the duration in milliseconds of the given byte count
+ * according to {@link #sampleSize}, {@link #channelCount} and {@link #sampleRate}.
*
* Byte Count -> Time
- *
+ *
*/
public final int getBytesDuration(int byteCount) {
final int bytesPerSample = sampleSize >>> 3; // /8
- return byteCount / ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
+ return byteCount / ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
}
-
+
/**
* Returns the duration in milliseconds of the given sample count per frame and channel
* according to the {@link #sampleRate}, i.e.
@@ -129,13 +129,13 @@ public interface AudioSink {
*
*
* Sample Count -> Time
- *
+ *
* @param sampleCount sample count per frame and channel
*/
public final float getSamplesDuration(int sampleCount) {
return ( 1000f * (float) sampleCount ) / (float)sampleRate;
}
-
+
/**
* Returns the rounded frame count of the given milliseconds and frame duration.
*
@@ -147,36 +147,36 @@ public interface AudioSink {
*
*
* Frame Time -> Frame Count
- *
+ *
* @param millisecs time in milliseconds
* @param frameDuration duration per frame in milliseconds.
*/
public final int getFrameCount(int millisecs, float frameDuration) {
return Math.max(1, (int) ( (float)millisecs / frameDuration + 0.5f ));
}
-
+
/**
* Returns the byte size of given sample count
- * according to the {@link #sampleSize}, i.e.:
+ * according to the {@link #sampleSize}, i.e.:
*
* sampleCount * ( sampleSize / 8 )
*
*
- * Note: To retrieve the byte size for all channels,
+ * Note: To retrieve the byte size for all channels,
* you need to pre-multiply sampleCount with {@link #channelCount}.
*
*
* Sample Count -> Byte Count
- *
+ *
* @param sampleCount sample count
*/
public final int getSamplesByteCount(int sampleCount) {
return sampleCount * ( sampleSize >>> 3 );
}
-
+
/**
* Returns the sample count of given byte count
- * according to the {@link #sampleSize}, i.e.:
+ * according to the {@link #sampleSize}, i.e.:
*
* ( byteCount * 8 ) / sampleSize
*
@@ -186,24 +186,24 @@ public interface AudioSink {
*
*
* Byte Count -> Sample Count
- *
+ *
* @param sampleCount sample count
*/
public final int getBytesSampleCount(int byteCount) {
return ( byteCount << 3 ) / sampleSize;
}
-
- public String toString() {
+
+ public String toString() {
return "AudioDataFormat[sampleRate "+sampleRate+", sampleSize "+sampleSize+", channelCount "+channelCount+
", signed "+signed+", fixedP "+fixedP+", "+(planar?"planar":"packed")+", "+(littleEndian?"little":"big")+"-endian]"; }
}
- /** Default {@link AudioFormat}, [type PCM, sampleRate 44100, sampleSize 16, channelCount 2, signed, fixedP, !planar, littleEndian]. */
- public static final AudioFormat DefaultFormat = new AudioFormat(44100, 16, 2, true /* signed */,
+ /** Default {@link AudioFormat}, [type PCM, sampleRate 44100, sampleSize 16, channelCount 2, signed, fixedP, !planar, littleEndian]. */
+ public static final AudioFormat DefaultFormat = new AudioFormat(44100, 16, 2, true /* signed */,
true /* fixed point */, false /* planar */, true /* littleEndian */);
-
+
public static abstract class AudioFrame extends TimeFrameI {
protected int byteSize;
-
+
public AudioFrame() {
this.byteSize = 0;
}
@@ -211,19 +211,19 @@ public interface AudioSink {
super(pts, duration);
this.byteSize=byteCount;
}
-
+
/** Get this frame's size in bytes. */
public final int getByteSize() { return byteSize; }
/** Set this frame's size in bytes. */
public final void setByteSize(int size) { this.byteSize=size; }
-
- public String toString() {
+
+ public String toString() {
return "AudioFrame[pts " + pts + " ms, l " + duration + " ms, "+byteSize + " bytes]";
}
}
public static class AudioDataFrame extends AudioFrame {
protected final ByteBuffer data;
-
+
public AudioDataFrame(int pts, int duration, ByteBuffer bytes, int byteCount) {
super(pts, duration, byteCount);
if( byteCount > bytes.remaining() ) {
@@ -231,62 +231,62 @@ public interface AudioSink {
}
this.data=bytes;
}
-
+
/** Get this frame's data. */
public final ByteBuffer getData() { return data; }
-
- public String toString() {
+
+ public String toString() {
return "AudioDataFrame[pts " + pts + " ms, l " + duration + " ms, "+byteSize + " bytes, " + data + "]";
}
}
-
- /**
+
+ /**
* Returns the initialized state of this instance.
*
* The initialized state is affected by this instance
* overall availability, i.e. after instantiation,
* as well as by {@link #destroy()}.
- *
+ *
*/
public boolean isInitialized();
/** Returns the playback speed. */
public float getPlaySpeed();
-
- /**
+
+ /**
* Sets the playback speed.
*
* To simplify test, play speed is normalized, i.e.
- *
- *
1.0f: if Math.abs(1.0f - rate) < 0.01f
+ *
+ *
1.0f: if Math.abs(1.0f - rate) < 0.01f
*
*
- * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
+ * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
*/
public boolean setPlaySpeed(float s);
-
+
/** Returns the volume. */
public float getVolume();
-
- /**
+
+ /**
* Sets the volume [0f..1f].
*
* To simplify test, volume is normalized, i.e.
- *
- *
0.0f: if Math.abs(v) < 0.01f
- *
1.0f: if Math.abs(1.0f - v) < 0.01f
+ *
+ *
0.0f: if Math.abs(v) < 0.01f
+ *
1.0f: if Math.abs(1.0f - v) < 0.01f
*
*
- * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
+ * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
*/
public boolean setVolume(float v);
-
- /**
+
+ /**
* Returns the preferred {@link AudioFormat} by this sink.
*
- * The preferred format is guaranteed to be supported
+ * The preferred format is guaranteed to be supported
* and shall reflect this sinks most native format,
- * i.e. best performance w/o data conversion.
+ * i.e. best performance w/o data conversion.
*
*
* Known {@link #AudioFormat} attributes considered by implementations:
@@ -295,20 +295,20 @@ public interface AudioSink {
*
*
* @see #initSink(AudioFormat)
- * @see #isSupported(AudioFormat)
+ * @see #isSupported(AudioFormat)
*/
public AudioFormat getPreferredFormat();
-
+
/** Return the maximum number of supported channels. */
public int getMaxSupportedChannels();
-
+
/**
* Returns true if the given format is supported by the sink, otherwise false.
* @see #initSink(AudioFormat)
- * @see #getPreferredFormat()
+ * @see #getPreferredFormat()
*/
public boolean isSupported(AudioFormat format);
-
+
/**
* Initializes the sink.
*
@@ -319,7 +319,7 @@ public interface AudioSink {
* beforehand and try to find a suitable supported one.
* {@link #getPreferredFormat()} and {@link #getMaxSupportedChannels()} may help.
*
- * @param requestedFormat the requested {@link AudioFormat}.
+ * @param requestedFormat the requested {@link AudioFormat}.
* @param frameDuration average or fixed frame duration in milliseconds
* helping a caching {@link AudioFrame} based implementation to determine the frame count in the queue.
* See {@link #DefaultFrameDuration}.
@@ -328,31 +328,31 @@ public interface AudioSink {
* @param queueLimit maximum time in milliseconds the queue can hold (and grow), see {@link #DefaultQueueLimitWithVideo} and {@link #DefaultQueueLimitAudioOnly}.
* @return true if successful, otherwise false
*/
- public boolean init(AudioFormat requestedFormat, float frameDuration,
+ public boolean init(AudioFormat requestedFormat, float frameDuration,
int initialQueueSize, int queueGrowAmount, int queueLimit);
-
+
/**
* Returns true, if {@link #play()} has been requested and the sink is still playing,
* otherwise false.
*/
public boolean isPlaying();
-
- /**
+
+ /**
* Play buffers queued via {@link #enqueueData(AudioFrame)} from current internal position.
* If no buffers are yet queued or the queue runs empty, playback is being continued when buffers are enqueued later on.
* @see #enqueueData(AudioFrame)
- * @see #pause()
+ * @see #pause()
*/
public void play();
-
- /**
+
+ /**
* Pause playing buffers while keeping enqueued data incl. it's internal position.
* @see #play()
* @see #flush()
* @see #enqueueData(AudioFrame)
*/
public void pause();
-
+
/**
* Flush all queued buffers, implies {@link #pause()}.
*
@@ -363,28 +363,28 @@ public interface AudioSink {
* @see #enqueueData(AudioFrame)
*/
public void flush();
-
+
/** Destroys this instance, i.e. closes all streams and devices allocated. */
public void destroy();
-
- /**
- * Returns the number of allocated buffers as requested by
+
+ /**
+ * Returns the number of allocated buffers as requested by
* {@link #init(AudioFormat, float, int, int, int)}.
*/
public int getFrameCount();
/** @return the current enqueued frames count since {@link #init(AudioFormat, float, int, int, int)}. */
public int getEnqueuedFrameCount();
-
- /**
+
+ /**
* Returns the current number of frames queued for playing.
*
* {@link #init(AudioFormat, float, int, int, int)} must be called first.
*
*/
public int getQueuedFrameCount();
-
- /**
+
+ /**
* Returns the current number of bytes queued for playing.
*
* {@link #init(AudioFormat, float, int, int, int)} must be called first.
@@ -392,28 +392,28 @@ public interface AudioSink {
*/
public int getQueuedByteCount();
- /**
+ /**
* Returns the current queued frame time in milliseconds for playing.
*
* {@link #init(AudioFormat, float, int, int, int)} must be called first.
*
*/
public int getQueuedTime();
-
- /**
+
+ /**
* Return the current audio presentation timestamp (PTS) in milliseconds.
*/
public int getPTS();
-
- /**
+
+ /**
* Returns the current number of frames in the sink available for writing.
*
* {@link #init(AudioFormat, float, int, int, int)} must be called first.
*
*/
public int getFreeFrameCount();
-
- /**
+
+ /**
* Enqueue the remaining bytes of the given {@link AudioDataFrame}'s direct ByteBuffer to this sink.
*
* The data must comply with the chosen {@link AudioFormat} as returned by {@link #initSink(AudioFormat)}.
@@ -426,8 +426,8 @@ public interface AudioSink {
* to reuse specialized {@link AudioFrame} instances.
*/
public AudioFrame enqueueData(AudioDataFrame audioDataFrame);
-
- /**
+
+ /**
* Enqueue byteCount bytes of the remaining bytes of the given NIO {@link ByteBuffer} to this sink.
*
* The data must comply with the chosen {@link AudioFormat} as returned by {@link #initSink(AudioFormat)}.
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
index a6a14f7dd..2cfd40df7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.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.
@@ -58,7 +58,7 @@ public class AudioSinkFactory {
if( audioSink.isInitialized() ) {
return audioSink;
}
- } catch (Throwable t) {
+ } catch (Throwable t) {
if(AudioSink.DEBUG) { System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); }
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 74036a3f7..db6f5fdee 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.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.
@@ -49,9 +49,9 @@ import com.jogamp.opengl.util.TimeFrameI;
* using the appropriate stream id's.
*
*
- * Camera input can be selected using the {@link #CameraInputScheme} URI.
+ * Camera input can be selected using the {@link #CameraInputScheme} URI.
*
* Most of the stream processing is performed on the decoding thread, a.k.a. StreamWorker:
@@ -61,7 +61,7 @@ import com.jogamp.opengl.util.TimeFrameI;
*
* StreamWorker generates it's own {@link GLContext}, shared with the one passed to {@link #initGL(GL)}.
- * The shared {@link GLContext} allows the decoding thread to push the video frame data directly into
+ * The shared {@link GLContext} allows the decoding thread to push the video frame data directly into
* the designated {@link TextureFrame}, later returned via {@link #getNextTexture(GL)} and used by the user.
*
* StreamWorker Error Handling
@@ -71,12 +71,12 @@ import com.jogamp.opengl.util.TimeFrameI;
*
*
* An occurring {@link StreamException} triggers a {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} event,
- * which can be listened to via {@link GLMediaEventListener#attributesChanged(GLMediaPlayer, int, long)}.
+ * which can be listened to via {@link GLMediaEventListener#attributesChanged(GLMediaPlayer, int, long)}.
*
*
- * An occurred {@link StreamException} can be read via {@link #getStreamException()}.
+ * An occurred {@link StreamException} can be read via {@link #getStreamException()}.
*
@@ -127,7 +127,7 @@ import com.jogamp.opengl.util.TimeFrameI;
* Timestamp type and value range has been chosen to suit embedded CPUs
* and characteristics of audio and video streaming. See {@link TimeFrameI}.
*
@@ -185,16 +185,16 @@ import com.jogamp.opengl.util.TimeFrameI;
public interface GLMediaPlayer extends TextureSequence {
public static final boolean DEBUG = Debug.debug("GLMediaPlayer");
public static final boolean DEBUG_NATIVE = Debug.debug("GLMediaPlayer.Native");
-
+
/** Minimum texture count, value {@value}. */
public static final int TEXTURE_COUNT_MIN = 4;
-
+
/** Constant {@value} for mute or not available. See Audio and video Stream IDs. */
public static final int STREAM_ID_NONE = -2;
/** Constant {@value} for auto or unspecified. See Audio and video Stream IDs. */
public static final int STREAM_ID_AUTO = -1;
-
- /**
+
+ /**
* {@link URI#getScheme() URI scheme} name {@value} for camera input. E.g. camera:/0
* for the 1st camera device.
*
* The ID is usually an integer value indexing the camera
- * ranging from [0..max-number].
+ * ranging from [0..max-number].
*
*
* The {@link URI#getRawQuery() URI query} is used to pass options to the camera
@@ -220,7 +220,7 @@ public interface GLMediaPlayer extends TextureSequence {
* w/ authority: [user-info@]host[:port]
* Note: 'path' starts w/ fwd slash
*
- *
+ *
*/
public static final String CameraInputScheme = "camera";
/** Camera property {@value}, size as string, e.g. 1280x720, hd720. May not be supported on all platforms. See {@link #CameraInputScheme}. */
@@ -231,10 +231,10 @@ public interface GLMediaPlayer extends TextureSequence {
public static final String CameraPropHeight = "height";
/** Camera property {@value}. See {@link #CameraInputScheme}. */
public static final String CameraPropRate = "rate";
-
+
/** Maximum video frame async of {@value} milliseconds. */
public static final int MAXIMUM_VIDEO_ASYNC = 22;
-
+
/**
* A StreamException encapsulates a caught exception in the decoder thread, a.k.a StreamWorker,
* see See StreamWorker Error Handling.
@@ -248,15 +248,15 @@ public interface GLMediaPlayer extends TextureSequence {
super(message, cause);
}
}
-
+
/**
* {@inheritDoc}
*
* See {@link TexSeqEventListener} for semantics and usage.
*
- */
+ */
public interface GLMediaEventListener extends TexSeqEventListener {
-
+
/** State changed to {@link State#Initialized}. See Lifecycle.*/
static final int EVENT_CHANGE_INIT = 1<<0;
/** State changed to {@link State#Uninitialized}. See Lifecycle.*/
@@ -269,7 +269,7 @@ public interface GLMediaPlayer extends TextureSequence {
static final int EVENT_CHANGE_EOS = 1<<4;
/** An error occurred, e.g. during off-thread initialization. See {@link StreamException} and Lifecycle. */
static final int EVENT_CHANGE_ERR = 1<<5;
-
+
/** Stream video id change. */
static final int EVENT_CHANGE_VID = 1<<16;
/** Stream audio id change. */
@@ -284,55 +284,55 @@ public interface GLMediaPlayer extends TextureSequence {
static final int EVENT_CHANGE_LENGTH = 1<<21;
/** Stream codec change. */
static final int EVENT_CHANGE_CODEC = 1<<22;
-
+
/**
- * @param mp the event source
+ * @param mp the event source
* @param event_mask the changes attributes
- * @param when system time in msec.
+ * @param when system time in msec.
*/
- public void attributesChanged(GLMediaPlayer mp, int event_mask, long when);
+ public void attributesChanged(GLMediaPlayer mp, int event_mask, long when);
}
-
+
/**
* See Lifecycle.
*/
public enum State {
/** Uninitialized player, no resources shall be hold. */
Uninitialized(0),
- /** Stream has been initialized, user may play or call {@link #initGL(GL)}. */
- Initialized(1),
+ /** Stream has been initialized, user may play or call {@link #initGL(GL)}. */
+ Initialized(1),
/** Stream is playing. */
Playing(2),
/** Stream is pausing. */
Paused(3);
-
+
public final int id;
State(int id){
this.id = id;
}
}
-
+
public int getTextureCount();
-
+
/** Returns the texture target used by implementation. */
public int getTextureTarget();
/** Sets the texture unit. Defaults to 0. */
public void setTextureUnit(int u);
-
+
/** Sets the texture min-mag filter, defaults to {@link GL#GL_NEAREST}. */
public void setTextureMinMagFilter(int[] minMagFilter);
/** Sets the texture min-mag filter, defaults to {@link GL#GL_CLAMP_TO_EDGE}. */
public void setTextureWrapST(int[] wrapST);
-
- /**
+
+ /**
* Issues asynchronous stream initialization.
*
* Muted video can be achieved by passing {@link #STREAM_ID_NONE} to vid,
- * in which case textureCount is ignored as well as the passed GL object of the subsequent {@link #initGL(GL)} call.
+ * in which case textureCount is ignored as well as the passed GL object of the subsequent {@link #initGL(GL)} call.
*
* @param streamLoc the stream location
* @param vid video stream id, see audio and video Stream IDs
@@ -352,41 +352,41 @@ public interface GLMediaPlayer extends TextureSequence {
* @param textureCount desired number of buffered textures to be decoded off-thread, will be validated by implementation.
* The minimum value is {@link #TEXTURE_COUNT_MIN}.
* Ignored if video is muted.
- * @throws IllegalStateException if not invoked in {@link State#Uninitialized}
+ * @throws IllegalStateException if not invoked in {@link State#Uninitialized}
* @throws IllegalArgumentException if arguments are invalid
*/
public void initStream(URI streamLoc, int vid, int aid, int textureCount) throws IllegalStateException, IllegalArgumentException;
-
+
/**
* Returns the {@link StreamException} caught in the decoder thread, or null.
* @see GLMediaEventListener#EVENT_CHANGE_ERR
* @see StreamException
*/
public StreamException getStreamException();
-
- /**
+
+ /**
* Initializes OpenGL related resources.
*
* Argument gl is ignored if video is muted, see {@link #initStream(URI, int, int, int)}.
- *
+ *
* @param gl current GL object. Maybe null, for audio only.
- * @throws IllegalStateException if not invoked in {@link State#Initialized}.
+ * @throws IllegalStateException if not invoked in {@link State#Initialized}.
* @throws StreamException forwarded from the off-thread stream initialization
* @throws GLException in case of difficulties to initialize the GL resources
*/
public void initGL(GL gl) throws IllegalStateException, StreamException, GLException;
-
- /**
+
+ /**
* If implementation uses a {@link AudioSink}, it's instance will be returned.
- *
- * The {@link AudioSink} instance is available after {@link #initStream(URI, int, int, int)},
+ *
+ * The {@link AudioSink} instance is available after {@link #initStream(URI, int, int, int)},
* if used by implementation.
- *
+ *
*/
public AudioSink getAudioSink();
-
+
/**
* Releases the GL and stream resources.
*
@@ -399,11 +399,11 @@ public interface GLMediaPlayer extends TextureSequence {
* Sets the playback speed.
*
* To simplify test, play speed is normalized, i.e.
- *
- *
1.0f: if Math.abs(1.0f - rate) < 0.01f
+ *
+ *
1.0f: if Math.abs(1.0f - rate) < 0.01f
*
*
- * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
+ * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
*/
public boolean setPlaySpeed(float rate);
@@ -414,18 +414,18 @@ public interface GLMediaPlayer extends TextureSequence {
* Sets the audio volume, [0f..1f].
*
* To simplify test, volume is normalized, i.e.
- *
- *
0.0f: if Math.abs(v) < 0.01f
- *
1.0f: if Math.abs(1.0f - v) < 0.01f
+ *
+ *
0.0f: if Math.abs(v) < 0.01f
+ *
1.0f: if Math.abs(1.0f - v) < 0.01f
*
*
- * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
+ * @return true if successful, otherwise false, i.e. due to unsupported value range of implementation.
*/
public boolean setAudioVolume(float v);
-
+
/** Returns the audio volume. */
public float getAudioVolume();
-
+
/**
* Starts or resumes the StreamWorker decoding thread.
*
* If a new frame is desired after the next {@link #play()} call,
- * e.g. to make a snapshot of a camera input stream,
+ * e.g. to make a snapshot of a camera input stream,
* flush shall be set to true.
- *
+ *
* @param flush if true flushes the video and audio buffers, otherwise keep them intact.
*/
public State pause(boolean flush);
@@ -454,10 +454,10 @@ public interface GLMediaPlayer extends TextureSequence {
*
* Allowed in state {@link State#Playing} and {@link State#Paused}, otherwise ignored,
* see Lifecycle.
- *
- *
- * @param msec absolute desired time position in milliseconds
- * @return time current position in milliseconds, after seeking to the desired position
+ *
+ *
+ * @param msec absolute desired time position in milliseconds
+ * @return time current position in milliseconds, after seeking to the desired position
**/
public int seek(int msec);
@@ -466,39 +466,39 @@ public interface GLMediaPlayer extends TextureSequence {
* @return the current state, either {@link State#Uninitialized}, {@link State#Initialized}, {@link State#Playing} or {@link State#Paused}
*/
public State getState();
-
+
/**
* Return the video stream id, see audio and video Stream IDs.
*/
public int getVID();
-
+
/**
* Return the audio stream id, see audio and video Stream IDs.
*/
public int getAID();
-
+
/**
- * @return the current decoded frame count since {@link #play()} and {@link #seek(int)}
+ * @return the current decoded frame count since {@link #play()} and {@link #seek(int)}
* as increased by {@link #getNextTexture(GL)} or the decoding thread.
*/
public int getDecodedFrameCount();
-
+
/**
- * @return the current presented frame count since {@link #play()} and {@link #seek(int)}
+ * @return the current presented frame count since {@link #play()} and {@link #seek(int)}
* as increased by {@link #getNextTexture(GL)} for new frames.
*/
public int getPresentedFrameCount();
-
+
/**
- * @return current video presentation timestamp (PTS) in milliseconds of {@link #getLastTexture()}
+ * @return current video presentation timestamp (PTS) in milliseconds of {@link #getLastTexture()}
**/
public int getVideoPTS();
-
+
/**
- * @return current audio presentation timestamp (PTS) in milliseconds.
+ * @return current audio presentation timestamp (PTS) in milliseconds.
**/
public int getAudioPTS();
-
+
/**
* {@inheritDoc}
*
* In case the current state is not {@link State#Playing}, {@link #getLastTexture()} is returned.
*
@@ -519,25 +519,25 @@ public interface GLMediaPlayer extends TextureSequence {
* See audio and video synchronization.
*
* @throws IllegalStateException if not invoked in {@link State#Paused} or {@link State#Playing}
- *
+ *
* @see #addEventListener(GLMediaEventListener)
* @see GLMediaEventListener#newFrameAvailable(GLMediaPlayer, TextureFrame, long)
*/
@Override
public TextureSequence.TextureFrame getNextTexture(GL gl) throws IllegalStateException;
-
+
/** Return the stream location, as set by {@link #initStream(URI, int, int, int)}. */
public URI getURI();
/**
* Warning: Optional information, may not be supported by implementation.
- * @return the code of the video stream, if available
+ * @return the code of the video stream, if available
*/
public String getVideoCodec();
/**
* Warning: Optional information, may not be supported by implementation.
- * @return the code of the audio stream, if available
+ * @return the code of the audio stream, if available
*/
public String getAudioCodec();
@@ -557,25 +557,25 @@ public interface GLMediaPlayer extends TextureSequence {
* @return total duration of stream in msec.
*/
public int getDuration();
-
+
/**
* Warning: Optional information, may not be supported by implementation.
- * @return the overall bitrate of the stream.
+ * @return the overall bitrate of the stream.
*/
public long getStreamBitrate();
/**
* Warning: Optional information, may not be supported by implementation.
- * @return video bitrate
+ * @return video bitrate
*/
public int getVideoBitrate();
-
+
/**
* Warning: Optional information, may not be supported by implementation.
- * @return the audio bitrate
+ * @return the audio bitrate
*/
public int getAudioBitrate();
-
+
/**
* Warning: Optional information, may not be supported by implementation.
* @return the framerate of the video
@@ -583,10 +583,10 @@ public interface GLMediaPlayer extends TextureSequence {
public float getFramerate();
/**
- * Returns true if the video frame is oriented in
+ * Returns true if the video frame is oriented in
* OpenGL's coordinate system, origin at bottom left.
*
- * Otherwise returns false, i.e.
+ * Otherwise returns false, i.e.
* video frame is oriented origin at top left.
*
*
@@ -594,14 +594,14 @@ public interface GLMediaPlayer extends TextureSequence {
* but user shall not rely on.
*
*
- * false GL orientation leads to
+ * false GL orientation leads to
* {@link Texture#getMustFlipVertically()} == true,
* as reflected by all {@link TextureFrame}'s {@link Texture}s
- * retrieved via {@link #getLastTexture()} or {@link #getNextTexture(GL)}.
+ * retrieved via {@link #getLastTexture()} or {@link #getNextTexture(GL)}.
*
*/
public boolean isGLOriented();
-
+
/** Returns the width of the video. */
public int getWidth();
@@ -613,7 +613,7 @@ public interface GLMediaPlayer extends TextureSequence {
/** Returns a string represantation of this player's performance values. */
public String getPerfString();
-
+
/** Adds a {@link GLMediaEventListener} to this player. */
public void addEventListener(GLMediaEventListener l);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
index c7e1ab5e6..248e265f5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.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.
@@ -36,7 +36,7 @@ public class GLMediaPlayerFactory {
private static final String FFMPEGMediaPlayerClazzName = "jogamp.opengl.util.av.impl.FFMPEGMediaPlayer";
private static final String OMXGLMediaPlayerClazzName = "jogamp.opengl.util.av.impl.OMXGLMediaPlayer";
private static final String isAvailableMethodName = "isAvailable";
-
+
public static GLMediaPlayer createDefault() {
final ClassLoader cl = GLMediaPlayerFactory.class.getClassLoader();
GLMediaPlayer sink = create(cl, OMXGLMediaPlayerClazzName);
@@ -54,7 +54,7 @@ public class GLMediaPlayerFactory {
public static GLMediaPlayer createNull() {
return new NullGLMediaPlayer();
}
-
+
public static GLMediaPlayer create(final ClassLoader cl, String implName) {
try {
if(((Boolean)ReflectionUtil.callStaticMethod(implName, isAvailableMethodName, null, null, cl)).booleanValue()) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
index 9d2ef6572..fb2bdbbcb 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.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,22 +41,22 @@ import javax.media.opengl.GL;
import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.util.GLPixelBuffer;
-/**
- * AWT {@link GLPixelBuffer} backed by an {@link BufferedImage} of type
+/**
+ * AWT {@link GLPixelBuffer} backed by an {@link BufferedImage} of type
* {@link BufferedImage#TYPE_INT_ARGB} or {@link BufferedImage#TYPE_INT_RGB}.
*
* Implementation uses an array backed {@link IntBuffer}.
*
*
- * {@link AWTGLPixelBuffer} can be produced via {@link AWTGLPixelBufferProvider}'s
- * {@link AWTGLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocate(..)}.
+ * {@link AWTGLPixelBuffer} can be produced via {@link AWTGLPixelBufferProvider}'s
+ * {@link AWTGLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocate(..)}.
*
*
* See {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)} for {@link #allowRowStride} details.
*
*
* If using allowRowStride == true, user may needs to get the {@link #getAlignedImage(int, int) aligned image}
- * since {@link #requiresNewBuffer(GL, int, int, int)} will allow different width in this case.
+ * since {@link #requiresNewBuffer(GL, int, int, int)} will allow different width in this case.
*
*/
public class AWTGLPixelBuffer extends GLPixelBuffer {
@@ -65,9 +65,9 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
/** The underlying {@link BufferedImage}. */
public final BufferedImage image;
-
+
/**
- *
+ *
* @param pixelAttributes the desired {@link GLPixelAttributes}
* @param width in pixels
* @param height in pixels
@@ -76,26 +76,26 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
* @param image the AWT image
* @param buffer the backing array
* @param allowRowStride If true, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
- * If true, user shall decide whether to use a {@link #getAlignedImage(int, int) width-aligned image}.
+ * If true, user shall decide whether to use a {@link #getAlignedImage(int, int) width-aligned image}.
*/
- public AWTGLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, BufferedImage image,
+ public AWTGLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, BufferedImage image,
Buffer buffer, boolean allowRowStride) {
super(pixelAttributes, width, height, depth, pack, buffer, allowRowStride);
this.image = image;
}
-
+
@Override
public void dispose() {
image.flush();
super.dispose();
}
-
+
/**
* Returns a width- and height-aligned image representation sharing data w/ {@link #image}.
* @param width
* @param height
* @return
- * @throws IllegalArgumentException if requested size exceeds image size
+ * @throws IllegalArgumentException if requested size exceeds image size
*/
public BufferedImage getAlignedImage(int width, int height) throws IllegalArgumentException {
if( width * height > image.getWidth() * image.getHeight() ) {
@@ -111,12 +111,12 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
final WritableRaster raster = image.getRaster();
final DataBuffer dataBuffer = raster.getDataBuffer();
final SinglePixelPackedSampleModel sppsm0 = (SinglePixelPackedSampleModel) raster.getSampleModel();
- final SinglePixelPackedSampleModel sppsm1 = new SinglePixelPackedSampleModel(dataBuffer.getDataType(),
+ final SinglePixelPackedSampleModel sppsm1 = new SinglePixelPackedSampleModel(dataBuffer.getDataType(),
width, height, width /* scanLineStride */, sppsm0.getBitMasks());
final WritableRaster raster1 = WritableRaster.createWritableRaster(sppsm1, dataBuffer, null);
return new BufferedImage (cm, raster1, cm.isAlphaPremultiplied(), null);
}
-
+
public StringBuilder toString(StringBuilder sb) {
sb = super.toString(sb);
sb.append(", allowRowStride ").append(allowRowStride).append(", image [").append(image.getWidth()).append("x").append(image.getHeight()).append(", ").append(image.toString()).append("]");
@@ -125,29 +125,29 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
public String toString() {
return "AWTGLPixelBuffer["+toString(null).toString()+"]";
}
-
+
/**
* Provider for {@link AWTGLPixelBuffer} instances.
*/
public static class AWTGLPixelBufferProvider implements GLPixelBufferProvider {
private final boolean allowRowStride;
-
+
/**
- * @param allowRowStride If true, allow row-stride, otherwise not.
+ * @param allowRowStride If true, allow row-stride, otherwise not.
* See {@link #getAllowRowStride()} and {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
- * If true, user shall decide whether to use a {@link AWTGLPixelBuffer#getAlignedImage(int, int) width-aligned image}.
+ * If true, user shall decide whether to use a {@link AWTGLPixelBuffer#getAlignedImage(int, int) width-aligned image}.
*/
public AWTGLPixelBufferProvider(boolean allowRowStride) {
- this.allowRowStride = allowRowStride;
+ this.allowRowStride = allowRowStride;
}
@Override
public boolean getAllowRowStride() { return allowRowStride; }
-
+
@Override
public GLPixelAttributes getAttributes(GL gl, int componentCount) {
return 4 == componentCount ? awtPixelAttributesIntRGBA4 : awtPixelAttributesIntRGB3;
}
-
+
/**
* {@inheritDoc}
*
@@ -162,28 +162,28 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
return new AWTGLPixelBuffer(pixelAttributes, width, height, depth, pack, image, ibuffer, allowRowStride);
}
}
-
+
/**
* Provider for singleton {@link AWTGLPixelBuffer} instances.
*
* Provider instance holds the last {@link AWTGLPixelBuffer} instance
* {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated}.
- * A new {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocation}
+ * A new {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocation}
* will return same instance, if a new buffer is not {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int) required}.
- * The latter is true if size are compatible, hence allowRowStride should be enabled, if possible.
+ * The latter is true if size are compatible, hence allowRowStride should be enabled, if possible.
*
@@ -194,7 +194,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
public AWTGLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
if( 4 == pixelAttributes.componentCount ) {
if( null == singleRGBA4 || singleRGBA4.requiresNewBuffer(gl, width, height, minByteSize) ) {
- singleRGBA4 = allocateImpl(pixelAttributes, width, height, depth, pack, minByteSize);
+ singleRGBA4 = allocateImpl(pixelAttributes, width, height, depth, pack, minByteSize);
}
return singleRGBA4;
} else {
@@ -204,33 +204,33 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
return singleRGB3;
}
}
-
+
private AWTGLPixelBuffer allocateImpl(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
final BufferedImage image = new BufferedImage(width, height, 4 == pixelAttributes.componentCount ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB);
final int[] readBackIntBuffer = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
final Buffer ibuffer = IntBuffer.wrap( readBackIntBuffer );
return new AWTGLPixelBuffer(pixelAttributes, width, height, depth, pack, image, ibuffer, getAllowRowStride());
}
-
- /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link AWTGLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
+
+ /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link AWTGLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
public AWTGLPixelBuffer getSingleBuffer(GLPixelAttributes pixelAttributes) {
return 4 == pixelAttributes.componentCount ? singleRGBA4 : singleRGB3;
}
-
- /**
+
+ /**
* Initializes the single {@link AWTGLPixelBuffer} w/ a given size, if not yet {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated}.
* @return the newly initialized single {@link AWTGLPixelBuffer}, or null if already allocated.
*/
public AWTGLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack) {
if( 4 == componentCount ) {
if( null != singleRGBA4 ) {
- return null;
+ return null;
}
singleRGBA4 = allocateImpl(AWTGLPixelBuffer.awtPixelAttributesIntRGBA4, width, height, depth, pack, 0);
return singleRGBA4;
} else {
if( null != singleRGB3 ) {
- return null;
+ return null;
}
singleRGB3 = allocateImpl(AWTGLPixelBuffer.awtPixelAttributesIntRGB3, width, height, depth, pack, 0);
return singleRGB3;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
index e85f04092..f5d31a132 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.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,7 +42,7 @@ import com.jogamp.opengl.util.GLReadBufferUtil;
public class AWTGLReadBufferUtil extends GLReadBufferUtil {
/**
* {@inheritDoc}
- *
+ *
* @param alpha
*/
public AWTGLReadBufferUtil(GLProfile glp, boolean alpha) {
@@ -50,7 +50,7 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
}
public AWTGLPixelBuffer getAWTGLPixelBuffer() { return (AWTGLPixelBuffer)this.getPixelBuffer(); }
-
+
public BufferedImage readPixelsToBufferedImage(GL gl, boolean awtOrientation) {
return readPixelsToBufferedImage(gl, 0, 0, 0, 0, awtOrientation);
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
index a3139b16a..df3cc4a39 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
@@ -54,7 +54,7 @@ public class ImageUtil {
WritableRaster raster = image.getRaster();
Object scanline1 = null;
Object scanline2 = null;
-
+
for (int i = 0; i < image.getHeight() / 2; i++) {
scanline1 = raster.getDataElements(0, i, image.getWidth(), 1, scanline1);
scanline2 = raster.getDataElements(0, image.getHeight() - i - 1, image.getWidth(), 1, scanline2);
@@ -97,21 +97,21 @@ public class ImageUtil {
if (thumbWidth > image.getWidth()) {
throw new IllegalArgumentException("Thumbnail width must be greater than image width");
}
-
+
if (thumbWidth == image.getWidth()) {
return image;
}
-
+
float ratio = (float) image.getWidth() / (float) image.getHeight();
int width = image.getWidth();
BufferedImage thumb = image;
-
+
do {
width /= 2;
if (width < thumbWidth) {
width = thumbWidth;
}
-
+
BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
Graphics2D g2 = temp.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
@@ -120,7 +120,7 @@ public class ImageUtil {
g2.dispose();
thumb = temp;
} while (width != thumbWidth);
-
+
return thumb;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
index 73d694cd9..931f59869 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
index 2ffc27260..f686b672a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2013 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.
@@ -56,18 +56,18 @@ import com.jogamp.opengl.GLExtensions;
import com.jogamp.opengl.util.GLPixelStorageModes;
import com.jogamp.opengl.util.TGAWriter;
-/**
+/**
* Utilities for taking screenshots of OpenGL applications.
- * @deprecated Please consider using {@link com.jogamp.opengl.util.GLReadBufferUtil},
- * which is AWT independent and does not require a CPU based vertical image flip
+ * @deprecated Please consider using {@link com.jogamp.opengl.util.GLReadBufferUtil},
+ * which is AWT independent and does not require a CPU based vertical image flip
* in case drawable {@link GLDrawable#isGLOriented() is in OpenGL orientation}.
- * Further more you may use {@link AWTGLReadBufferUtil} to read out
+ * Further more you may use {@link AWTGLReadBufferUtil} to read out
* the framebuffer into a BufferedImage for further AWT processing.
*/
public class Screenshot {
private Screenshot() {}
- /**
+ /**
* Takes a fast screenshot of the current OpenGL drawable to a Targa
* file. Requires the OpenGL context for the desired drawable to be
* current. Takes the screenshot from the last assigned read buffer,
@@ -94,7 +94,7 @@ public class Screenshot {
writeToTargaFile(file, width, height, false);
}
- /**
+ /**
* Takes a fast screenshot of the current OpenGL drawable to a Targa
* file. Requires the OpenGL context for the desired drawable to be
* current. Takes the screenshot from the last assigned read buffer,
@@ -122,7 +122,7 @@ public class Screenshot {
writeToTargaFile(file, 0, 0, width, height, alpha);
}
- /**
+ /**
* Takes a fast screenshot of the current OpenGL drawable to a Targa
* file. Requires the OpenGL context for the desired drawable to be
* current. Takes the screenshot from the last assigned read buffer,
@@ -410,5 +410,5 @@ public class Screenshot {
if (!gl.isExtensionAvailable(GLExtensions.EXT_abgr)) {
throw new IllegalArgumentException("Saving alpha channel requires GL_EXT_abgr");
}
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
index c67141525..6e504c089 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
@@ -129,7 +129,7 @@ import jogamp.opengl.Debug;
*/
public class TextRenderer {
private static final boolean DEBUG;
-
+
static {
Debug.initSingleton();
DEBUG = Debug.isPropertyDefined("jogl.debug.TextRenderer", true);
@@ -200,10 +200,10 @@ public class TextRenderer {
// Debugging purposes only
private boolean debugged;
Pipelined_QuadRenderer mPipelinedQuadRenderer;
-
+
//emzic: added boolean flag
private boolean useVertexArrays = true;
-
+
//emzic: added boolean flag
private boolean isExtensionAvailable_GL_VERSION_1_5;
private boolean checkFor_isExtensionAvailable_GL_VERSION_1_5;
@@ -707,7 +707,7 @@ public class TextRenderer {
/**
* emzic: here the call to glBindBuffer crashes on certain graphicscard/driver combinations
* this is why the ugly try-catch block has been added, which falls back to the old textrenderer
- *
+ *
* @param ortho
* @throws GLException
*/
@@ -891,7 +891,7 @@ public class TextRenderer {
data.markUsed();
Rectangle2D origRect = data.origRect();
-
+
// Align the leftmost point of the baseline to the (x, y, z) coordinate requested
renderer.draw3DRect(x - (scaleFactor * data.origOriginX()),
y - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY())), z,
@@ -1715,7 +1715,7 @@ public class TextRenderer {
return glyph;
}
}
-
+
private static class CharacterCache {
private CharacterCache() {
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
index 922fc69c1..26e1eb041 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.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.
*/
@@ -407,7 +407,7 @@ public class TextureRenderer {
this.a = a;
gl.glColor4f(this.r, this.g, this.b, this.a);
- }
+ }
private float[] compArray;
/** Changes the current color of this TextureRenderer to the
@@ -437,7 +437,7 @@ public class TextureRenderer {
@param screenx the on-screen x coordinate at which to draw the rectangle
@param screeny the on-screen y coordinate (relative to lower left) at
which to draw the rectangle
-
+
@throws GLException If an OpenGL context is not current when this method is called
*/
public void drawOrthoRect(int screenx, int screeny) throws GLException {
@@ -459,7 +459,7 @@ public class TextureRenderer {
rectangle to draw
@param width the width of the rectangle to draw
@param height the height of the rectangle to draw
-
+
@throws GLException If an OpenGL context is not current when this method is called
*/
public void drawOrthoRect(int screenx, int screeny,
@@ -490,7 +490,7 @@ public class TextureRenderer {
@param height the height in texels of the rectangle to draw
@param scaleFactor the scale factor to apply (multiplicatively)
to the size of the drawn rectangle
-
+
@throws GLException If an OpenGL context is not current when this method is called
*/
public void draw3DRect(float x, float y, float z,
@@ -518,7 +518,7 @@ public class TextureRenderer {
OpenGL texture to the screen, if the application intends to draw
them as a flat overlay on to the screen. Must be used if {@link
#beginOrthoRendering} is used to set up the rendering stage for
- this overlay.
+ this overlay.
@throws GLException If an OpenGL context is not current when this method is called
*/
@@ -552,7 +552,7 @@ public class TextureRenderer {
private void beginRendering(boolean ortho, int width, int height, boolean disableDepthTestForOrtho) {
GL2 gl = GLContext.getCurrentGL().getGL2();
- int attribBits =
+ int attribBits =
GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL2.GL_COLOR_BUFFER_BIT |
(ortho ? (GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_TRANSFORM_BIT) : 0);
gl.glPushAttrib(attribBits);
@@ -622,7 +622,7 @@ public class TextureRenderer {
// Infer the internal format if not an intensity texture
int internalFormat = (intensity ? GL2.GL_INTENSITY : 0);
- int imageType =
+ int imageType =
(intensity ? BufferedImage.TYPE_BYTE_GRAY :
(alpha ? BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_RGB));
image = new BufferedImage(width, height, imageType);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
index 34685e1b2..e8df6aaec 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
-/* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
class BitmapCharRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
index 18f7d3b28..d4ee12b32 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
-/* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
class BitmapFontRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
index 9ad95ec03..5e26e0d14 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
-/* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
class CoordRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
index 010ce6699..42529f3f1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -163,7 +163,7 @@ public class GLUT {
public void glutSolidCylinder(double radius, double height, int slices, int stacks) {
GL2 gl = GLUgl2.getCurrentGL2();
-
+
// Prepare table of points for drawing end caps
double [] x = new double[slices];
double [] y = new double[slices];
@@ -174,7 +174,7 @@ public class GLUT {
x[i] = Math.cos(angle) * radius;
y[i] = Math.sin(angle) * radius;
}
-
+
// Draw bottom cap
gl.glBegin(GL2.GL_TRIANGLE_FAN);
gl.glNormal3d(0,0,-1);
@@ -184,7 +184,7 @@ public class GLUT {
}
gl.glVertex3d(x[0], y[0], 0);
gl.glEnd();
-
+
// Draw top cap
gl.glBegin(GL2.GL_TRIANGLE_FAN);
gl.glNormal3d(0,0,1);
@@ -194,7 +194,7 @@ public class GLUT {
}
gl.glVertex3d(x[0], y[0], height);
gl.glEnd();
-
+
// Draw walls
quadObjInit(glu);
glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
@@ -262,7 +262,7 @@ public class GLUT {
/**
* Renders the teapot as a solid shape of the specified size. The teapot is
* created in a way that replicates the C GLUT implementation.
- *
+ *
* @param scale
* the factor by which to scale the teapot
*/
@@ -278,7 +278,7 @@ public class GLUT {
* instead of the y=-1 plane). Both surface normals and texture coordinates
* for the teapot are generated. The teapot is generated with OpenGL
* evaluators.
- *
+ *
* @param scale
* the factor by which to scale the teapot
* @param cStyle
@@ -292,14 +292,14 @@ public class GLUT {
/**
* Renders the teapot as a wireframe shape of the specified size. The teapot
* is created in a way that replicates the C GLUT implementation.
- *
+ *
* @param scale
* the factor by which to scale the teapot
*/
public void glutWireTeapot(double scale) {
glutWireTeapot(scale, true);
}
-
+
/**
* Renders the teapot as a wireframe shape of the specified size. The teapot
* can either be created in a way that is backward-compatible with the
@@ -308,7 +308,7 @@ public class GLUT {
* plane, instead of the y=-1 plane). Both surface normals and texture
* coordinates for the teapot are generated. The teapot is generated with
* OpenGL evaluators.
- *
+ *
* @param scale
* the factor by which to scale the teapot
* @param cStyle
@@ -356,7 +356,7 @@ public class GLUT {
int[] skiprows = new int[1];
int[] skippixels = new int[1];
int[] alignment = new int[1];
- beginBitmap(gl,
+ beginBitmap(gl,
swapbytes,
lsbfirst,
rowlength,
@@ -367,7 +367,7 @@ public class GLUT {
for (int i = 0; i < len; i++) {
bitmapCharacterImpl(gl, font, string.charAt(i));
}
- endBitmap(gl,
+ endBitmap(gl,
swapbytes,
lsbfirst,
rowlength,
@@ -502,7 +502,7 @@ public class GLUT {
gl.glEnd( );
}
}
-
+
/**
This function draws a solid-shaded dodecahedron
whose facets are rhombic and
@@ -522,7 +522,7 @@ public class GLUT {
}
gl.glEnd( );
}
-
+
//----------------------------------------------------------------------
// Internals only below this point
//
@@ -879,7 +879,7 @@ public class GLUT {
}
/* rhombic dodecahedron data: */
-
+
private static final double rdod_r[][] =
{
{ 0.0, 0.0, 1.0 },
@@ -897,7 +897,7 @@ public class GLUT {
{ 0.000000000000, -0.707106781187, -0.5 },
{ 0.0, 0.0, -1.0 }
};
-
+
private static final int rdod_v[][] =
{
{ 0, 1, 5, 2 },
@@ -913,7 +913,7 @@ public class GLUT {
{ 7, 11, 13, 12 },
{ 8, 12, 13, 9 }
};
-
+
private static final double rdod_n[][] =
{
{ 0.353553390594, 0.353553390594, 0.5 },
@@ -929,7 +929,7 @@ public class GLUT {
{ -0.353553390594, -0.353553390594, -0.5 },
{ 0.353553390594, -0.353553390594, -0.5 }
};
-
+
/* tetrahedron data: */
private static final float T = 1.73205080756887729f;
@@ -1124,7 +1124,7 @@ public class GLUT {
float[] r = new float[4*4*3];
float[] s = new float[4*4*3];
int i, j, k, l;
-
+
gl.glPushAttrib(GL2.GL_ENABLE_BIT | GL2.GL_EVAL_BIT | GL2.GL_POLYGON_BIT);
gl.glEnable(GL2.GL_AUTO_NORMAL);
gl.glEnable(GL2.GL_NORMALIZE);
@@ -1183,7 +1183,7 @@ public class GLUT {
gl.glPopMatrix();
gl.glPopAttrib();
}
-
+
private static void evaluateTeapotMesh(GL2 gl,
int grid,
int type,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java
index 07ded652a..c24483777 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java
index 5d357f3f7..62af3b631 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java
index b9c7e6e50..5f06d697e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java
index bc86f6216..8326d6461 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java
index 1b2e69ba4..cb11f6bec 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java
index f753b56f7..17cbd0796 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java
index 073e6e673..9cc2bdc3a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
index b8296924e..3587ca992 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
index 94fa1c4fd..cf51ddd3c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
index af3d538ae..515212f0e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
-/* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
class StrokeCharRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
index d3195f24d..5335c8523 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -41,8 +41,8 @@ package com.jogamp.opengl.util.gl2;
/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
-/* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
class StrokeFontRec {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
index 8796e8b08..b0c91c696 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -41,14 +41,14 @@ package com.jogamp.opengl.util.gl2;
/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
-/* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
class StrokeRec {
public int num_coords;
public CoordRec[] coord;
-
+
public StrokeRec(int num_coords,
CoordRec[] coord) {
this.num_coords = num_coords;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index edc3d2677..68c1d0fec 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -62,7 +62,7 @@ import com.jogamp.common.util.VersionNumber;
* A documented example of how to use this code is available
* {@link #create(GL2ES2, int, Class, String, String, String, boolean) here} and
* {@link #create(GL2ES2, int, int, Class, String, String[], String, String) here}.
- *
+ *
*/
public class ShaderCode {
public static final boolean DEBUG = Debug.debug("GLSLCode");
@@ -70,22 +70,22 @@ public class ShaderCode {
/** Unique resource suffix for {@link GL2ES2#GL_VERTEX_SHADER} in source code: vp */
public static final String SUFFIX_VERTEX_SOURCE = "vp" ;
-
+
/** Unique resource suffix for {@link GL2ES2#GL_VERTEX_SHADER} in binary: bvp */
public static final String SUFFIX_VERTEX_BINARY = "bvp" ;
-
+
/** Unique resource suffix for {@link GL3#GL_GEOMETRY_SHADER} in source code: gp */
public static final String SUFFIX_GEOMETRY_SOURCE = "gp" ;
-
+
/** Unique resource suffix for {@link GL3#GL_GEOMETRY_SHADER} in binary: bgp */
public static final String SUFFIX_GEOMETRY_BINARY = "bgp" ;
-
+
/** Unique resource suffix for {@link GL2ES2#GL_FRAGMENT_SHADER} in source code: fp */
public static final String SUFFIX_FRAGMENT_SOURCE = "fp" ;
-
+
/** Unique resource suffix for {@link GL2ES2#GL_FRAGMENT_SHADER} in binary: bfp */
public static final String SUFFIX_FRAGMENT_BINARY = "bfp" ;
-
+
/** Unique relative path for binary shader resources for {@link GLES2#GL_NVIDIA_PLATFORM_BINARY_NV NVIDIA}: nvidia */
public static final String SUB_PATH_NVIDIA = "nvidia" ;
@@ -94,7 +94,7 @@ public class ShaderCode {
* @param count number of shaders
* @param source CharSequence array containing the shader sources, organized as source[count][strings-per-shader].
* May be either an immutable String - or mutable StringBuilder array.
- *
+ *
* @throws IllegalArgumentException if count and source.length do not match
*/
public ShaderCode(int type, int count, CharSequence[][] source) {
@@ -125,7 +125,7 @@ public class ShaderCode {
/**
* @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
* @param count number of shaders
- * @param binary binary buffer containing the shader binaries,
+ * @param binary binary buffer containing the shader binaries,
*/
public ShaderCode(int type, int count, int binFormat, Buffer binary) {
switch (type) {
@@ -147,19 +147,19 @@ public class ShaderCode {
/**
* Creates a complete {@link ShaderCode} object while reading all shader source of sourceFiles,
* which location is resolved using the context class, see {@link #readShaderSource(Class, String)}.
- *
+ *
* @param gl current GL object to determine whether a shader compiler is available. If null, no validation is performed.
* @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
* @param count number of shaders
* @param context class used to help resolving the source location
* @param sourceFiles array of source locations, organized as sourceFiles[count]
* @param mutableStringBuilder if true method returns a mutable StringBuilder instance
- * which can be edited later on at the costs of a String conversion when passing to
+ * which can be edited later on at the costs of a String conversion when passing to
* {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}.
* If false method returns an immutable String instance,
* which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
* at no additional costs.
- *
+ *
* @throws IllegalArgumentException if count and sourceFiles.length do not match
* @see #readShaderSource(Class, String)
*/
@@ -192,16 +192,16 @@ public class ShaderCode {
/**
* Creates a complete {@link ShaderCode} object while reading the shader binary of binaryFile,
* which location is resolved using the context class, see {@link #readShaderBinary(Class, String)}.
- *
+ *
* @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
* @param count number of shaders
* @param context class used to help resolving the source location
* @param binFormat a valid native binary format as they can be queried by {@link ShaderUtil#getShaderBinaryFormats(GL)}.
* @param sourceFiles array of source locations, organized as sourceFiles[count]
- *
+ *
* @see #readShaderBinary(Class, String)
* @see ShaderUtil#getShaderBinaryFormats(GL)
- */
+ */
public static ShaderCode create(int type, int count, Class> context, int binFormat, String binaryFile) {
ByteBuffer shaderBinary = null;
if(null!=binaryFile && 0<=binFormat) {
@@ -231,12 +231,12 @@ public class ShaderCode {
*
- * @param binary true for a binary resource, false for a source resource
+ *
+ * @param binary true for a binary resource, false for a source resource
* @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
- *
+ *
* @throws GLException if type is not supported
- *
+ *
* @see #create(GL2ES2, int, Class, String, String, String, boolean)
*/
public static String getFileSuffix(boolean binary, int type) {
@@ -252,16 +252,16 @@ public class ShaderCode {
}
}
- /**
+ /**
* Returns a unique relative path for binary shader resources as follows:
*
- *
+ *
* @throws GLException if binFormat is not supported
- *
+ *
* @see #create(GL2ES2, int, Class, String, String, String, boolean)
- */
+ */
public static String getBinarySubPath(int binFormat) {
switch (binFormat) {
case GLES2.GL_NVIDIA_PLATFORM_BINARY_NV:
@@ -272,42 +272,42 @@ public class ShaderCode {
}
/**
- * Convenient creation method for instantiating a complete {@link ShaderCode} object
- * either from source code using {@link #create(GL2ES2, int, int, Class, String[])},
+ * Convenient creation method for instantiating a complete {@link ShaderCode} object
+ * either from source code using {@link #create(GL2ES2, int, int, Class, String[])},
* or from a binary code using {@link #create(int, int, Class, int, String)},
* whatever is available first.
*
- * The source and binary location names are expected w/o suffixes which are
+ * The source and binary location names are expected w/o suffixes which are
* resolved and appended using {@link #getFileSuffix(boolean, int)}.
*
*
* Additionally, the binary resource is expected within a subfolder of binRoot
* which reflects the vendor specific binary format, see {@link #getBinarySubPath(int)}.
* All {@link ShaderUtil#getShaderBinaryFormats(GL)} are being iterated
- * using the binary subfolder, the first existing resource is being used.
+ * using the binary subfolder, the first existing resource is being used.
*
- *
+ *
* Example:
*
* Your std JVM layout (plain or within a JAR):
- *
+ *
* org/test/glsl/MyShaderTest.class
* org/test/glsl/shader/vertex.vp
* org/test/glsl/shader/fragment.fp
* org/test/glsl/shader/bin/nvidia/vertex.bvp
* org/test/glsl/shader/bin/nvidia/fragment.bfp
- *
+ *
* Your Android APK layout:
- *
+ *
* classes.dex
* assets/org/test/glsl/shader/vertex.vp
* assets/org/test/glsl/shader/fragment.fp
* assets/org/test/glsl/shader/bin/nvidia/vertex.bvp
* assets/org/test/glsl/shader/bin/nvidia/fragment.bfp
* ...
- *
+ *
* Your invocation in org/test/glsl/MyShaderTest.java:
- *
+ *
* ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, 1, this.getClass(),
* "shader", new String[] { "vertex" }, "shader/bin", "vertex");
* ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, 1, this.getClass(),
@@ -318,11 +318,11 @@ public class ShaderCode {
* st.attachShaderProgram(gl, sp0, true);
*
* A simplified entry point is {@link #create(GL2ES2, int, Class, String, String, String, boolean)}.
- *
+ *
*
* The location is finally being resolved using the context class, see {@link #readShaderBinary(Class, String)}.
*
- *
+ *
* @param gl current GL object to determine whether a shader compiler is available (if source is used),
* or to determine the shader binary format (if binary is used).
* @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
@@ -333,22 +333,22 @@ public class ShaderCode {
* @param binRoot relative root path for binBasenames
* @param binBasename basename w/o path or suffix relative to binRoot for the shader's binary code
* @param mutableStringBuilder if true method returns a mutable StringBuilder instance
- * which can be edited later on at the costs of a String conversion when passing to
+ * which can be edited later on at the costs of a String conversion when passing to
* {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}.
* If false method returns an immutable String instance,
* which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
* at no additional costs.
- *
+ *
* @throws IllegalArgumentException if count and srcBasenames.length do not match
- *
+ *
* @see #create(GL2ES2, int, int, Class, String[])
* @see #create(int, int, Class, int, String)
* @see #readShaderSource(Class, String)
* @see #getFileSuffix(boolean, int)
* @see ShaderUtil#getShaderBinaryFormats(GL)
* @see #getBinarySubPath(int)
- */
- public static ShaderCode create(GL2ES2 gl, int type, int count, Class> context,
+ */
+ public static ShaderCode create(GL2ES2 gl, int type, int count, Class> context,
String srcRoot, String[] srcBasenames, String binRoot, String binBasename,
boolean mutableStringBuilder) {
ShaderCode res = null;
@@ -391,28 +391,28 @@ public class ShaderCode {
/**
* Simplified variation of {@link #create(GL2ES2, int, int, Class, String, String[], String, String)}.
*
- *
+ *
* Example:
*
- *
+ *
* @param gl current GL object to determine whether a shader compiler is available (if source is used),
* or to determine the shader binary format (if binary is used).
* @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
@@ -433,20 +433,20 @@ public class ShaderCode {
* @param basenames basename w/o path or suffix relative to srcRoot and binRoot
* for the shader's source and binary code.
* @param mutableStringBuilder if true method returns a mutable StringBuilder instance
- * which can be edited later on at the costs of a String conversion when passing to
+ * which can be edited later on at the costs of a String conversion when passing to
* {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}.
* If false method returns an immutable String instance,
* which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
* at no additional costs.
* @throws IllegalArgumentException if count is not 1
- *
+ *
* @see #create(GL2ES2, int, int, Class, String, String[], String, String)
- */
- public static ShaderCode create(GL2ES2 gl, int type, Class> context,
+ */
+ public static ShaderCode create(GL2ES2 gl, int type, Class> context,
String srcRoot, String binRoot, String basename, boolean mutableStringBuilder) {
- return create(gl, type, 1, context, srcRoot, new String[] { basename }, binRoot, basename, mutableStringBuilder );
+ return create(gl, type, 1, context, srcRoot, new String[] { basename }, binRoot, basename, mutableStringBuilder );
}
-
+
/**
* returns the uniq shader id as an integer
*/
@@ -455,7 +455,7 @@ public class ShaderCode {
public int shaderType() { return shaderType; }
public String shaderTypeStr() { return shaderTypeStr(shaderType); }
- public static String shaderTypeStr(int type) {
+ public static String shaderTypeStr(int type) {
switch (type) {
case GL2ES2.GL_VERTEX_SHADER:
return "VERTEX_SHADER";
@@ -553,7 +553,7 @@ public class ShaderCode {
} else {
CharSequence[] src = shaderSource[i];
int lineno=0;
-
+
for(int j=0; jdata after the line containing tag.
*
* Note: The shader source to be edit must be created using a mutable StringBuilder.
*
- *
+ *
* @param shaderIdx the shader index to be used.
* @param tag search string
* @param fromIndex start search tag begininig with this index
* @param data the text to be inserted. Shall end with an EOL '\n' character.
* @return index after the inserted data
- *
+ *
* @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type StringBuilder
*/
public int insertShaderSource(int shaderIdx, String tag, int fromIndex, CharSequence data) {
@@ -595,7 +595,7 @@ public class ShaderCode {
final int sourceCount = (null!=shaderSource)?shaderSource.length:0;
if(shaderIdx>=sourceCount) {
throw new IndexOutOfBoundsException("shaderIdx not within source bounds [0.."+(sourceCount-1)+"]: "+shaderIdx);
- }
+ }
final CharSequence[] src = shaderSource[shaderIdx];
int curEndIndex = 0;
for(int j=0; joldName with newName in all shader sources.
*
* In case oldName and newName are equal, no action is performed.
- *
+ *
*
* Note: The shader source to be edit must be created using a mutable StringBuilder.
*
- *
+ *
* @param oldName the to be replace string
* @param newName the replacement string
* @return the number of replacements
- *
+ *
* @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type StringBuilder
*/
public int replaceInShaderSource(String oldName, String newName) {
@@ -675,18 +675,18 @@ public class ShaderCode {
}
return num;
}
-
+
/**
* Adds data at offset in shader source for shader shaderIdx.
*
* Note: The shader source to be edit must be created using a mutable StringBuilder.
*
- *
+ *
* @param shaderIdx the shader index to be used.
* @param position in shader source segments of shader shaderIdx
* @param data the text to be inserted. Shall end with an EOL '\n' character
* @return index after the inserted data
- *
+ *
* @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type StringBuilder
*/
public int insertShaderSource(int shaderIdx, int position, CharSequence data) {
@@ -700,7 +700,7 @@ public class ShaderCode {
final int sourceCount = (null!=shaderSource)?shaderSource.length:0;
if(shaderIdx>=sourceCount) {
throw new IndexOutOfBoundsException("shaderIdx not within source bounds [0.."+(sourceCount-1)+"]: "+shaderIdx);
- }
+ }
final CharSequence[] src = shaderSource[shaderIdx];
int curEndIndex = 0;
for(int j=0; j context, URLConnection conn, StringBuilder result) throws IOException {
readShaderSource(context, conn, result, 0);
}
-
+
/**
* Reads shader source located in path,
* either relative to the context class or absolute as-is.
@@ -774,21 +774,21 @@ public class ShaderCode {
* Final location lookup is performed via {@link ClassLoader#getResource(String)} and {@link ClassLoader#getSystemResource(String)},
* see {@link IOUtil#getResource(Class, String)}.
*
- *
+ *
* @param context class used to help resolve the source location
* @param path location of shader source
* @param mutableStringBuilder if true method returns a mutable StringBuilder instance
- * which can be edited later on at the costs of a String conversion when passing to
+ * which can be edited later on at the costs of a String conversion when passing to
* {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}.
* If false method returns an immutable String instance,
* which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
* at no additional costs.
- * @throws IOException
- *
+ * @throws IOException
+ *
* @see IOUtil#getResource(Class, String)
- */
+ */
public static CharSequence readShaderSource(Class> context, String path, boolean mutableStringBuilder) throws IOException {
- URLConnection conn = IOUtil.getResource(context, path);
+ URLConnection conn = IOUtil.getResource(context, path);
if (conn == null) {
return null;
}
@@ -798,17 +798,17 @@ public class ShaderCode {
}
/**
- * Reads shader binary located in path,
+ * Reads shader binary located in path,
* either relative to the context class or absolute as-is.
*
* Final location lookup is perfomed via {@link ClassLoader#getResource(String)} and {@link ClassLoader#getSystemResource(String)},
* see {@link IOUtil#getResource(Class, String)}.
*
- *
+ *
* @param context class used to help resolve the source location
* @param path location of shader binary
- * @throws IOException
- *
+ * @throws IOException
+ *
* @see IOUtil#getResource(Class, String)
*/
public static ByteBuffer readShaderBinary(Class> context, String path) throws IOException {
@@ -824,41 +824,41 @@ public class ShaderCode {
}
}
- // Shall we use: #ifdef GL_FRAGMENT_PRECISION_HIGH .. #endif for using highp in fragment shader if avail ?
+ // Shall we use: #ifdef GL_FRAGMENT_PRECISION_HIGH .. #endif for using highp in fragment shader if avail ?
/** Default precision of {@link GL#isGLES2() ES2} for {@link GL2ES2#GL_VERTEX_SHADER vertex-shader}: {@value #es2_default_precision_vp} */
public static final String es2_default_precision_vp = "\nprecision highp float;\nprecision highp int;\n";
/** Default precision of {@link GL#isGLES2() ES2} for {@link GL2ES2#GL_FRAGMENT_SHADER fragment-shader}: {@value #es2_default_precision_fp} */
public static final String es2_default_precision_fp = "\nprecision mediump float;\nprecision mediump int;\n/*precision lowp sampler2D;*/\n";
-
+
/** Default precision of GLSL ≥ 1.30 as required until < 1.50 for {@link GL2ES2#GL_VERTEX_SHADER vertex-shader} or {@link GL3#GL_GEOMETRY_SHADER geometry-shader}: {@value #gl3_default_precision_vp_gp}. See GLSL Spec 1.30-1.50 Section 4.5.3. */
public static final String gl3_default_precision_vp_gp = "\nprecision highp float;\nprecision highp int;\n";
/** Default precision of GLSL ≥ 1.30 as required until < 1.50 for {@link GL2ES2#GL_FRAGMENT_SHADER fragment-shader}: {@value #gl3_default_precision_fp}. See GLSL Spec 1.30-1.50 Section 4.5.3. */
public static final String gl3_default_precision_fp = "\nprecision highp float;\nprecision mediump int;\n/*precision mediump sampler2D;*/\n";
-
+
/** Prefer enable over require, since it won't force a failure. */
public static final String extOESDerivativesEnable = "#extension GL_OES_standard_derivatives : enable\n";
-
+
/**
* Add GLSL version at the head of this shader source code.
*
* Note: The shader source to be edit must be created using a mutable StringBuilder.
*
- * @param gl a GL context, which must have been made current once
+ * @param gl a GL context, which must have been made current once
* @return the index after the inserted data, maybe 0 if nothing has be inserted.
*/
public final int addGLSLVersion(GL2ES2 gl) {
return insertShaderSource(0, 0, gl.getContext().getGLSLVersionString());
}
-
+
/**
* Adds default precision to source code at given position if required, i.e.
- * {@link #es2_default_precision_vp}, {@link #es2_default_precision_fp},
+ * {@link #es2_default_precision_vp}, {@link #es2_default_precision_fp},
* {@link #gl3_default_precision_vp_gp}, {@link #gl3_default_precision_fp} or none,
* depending on the {@link GLContext#getGLSLVersionNumber() GLSL version} being used.
*
* Note: The shader source to be edit must be created using a mutable StringBuilder.
*
- * @param gl a GL context, which must have been made current once
+ * @param gl a GL context, which must have been made current once
* @param pos position within this mutable shader source.
* @return the index after the inserted data, maybe 0 if nothing has be inserted.
*/
@@ -871,7 +871,7 @@ public class ShaderCode {
case GL2ES2.GL_FRAGMENT_SHADER:
defaultPrecision = es2_default_precision_vp; break;
default:
- defaultPrecision = null;
+ defaultPrecision = null;
break;
}
} else if( requiresGL3DefaultPrecision(gl) ) {
@@ -883,7 +883,7 @@ public class ShaderCode {
case GL2ES2.GL_FRAGMENT_SHADER:
defaultPrecision = gl3_default_precision_fp; break;
default:
- defaultPrecision = null;
+ defaultPrecision = null;
break;
}
} else {
@@ -894,7 +894,7 @@ public class ShaderCode {
}
return pos;
}
-
+
/** Returns true, if GLSL version requires default precision, i.e. ES2 or GLSL [1.30 .. 1.50[. */
public static final boolean requiresDefaultPrecision(GL2ES2 gl) {
if( gl.isGLES2() ) {
@@ -902,7 +902,7 @@ public class ShaderCode {
}
return requiresGL3DefaultPrecision(gl);
}
-
+
/** Returns true, if GL3 GLSL version requires default precision, i.e. GLSL [1.30 .. 1.50[. */
public static final boolean requiresGL3DefaultPrecision(GL2ES2 gl) {
if( gl.isGL3() ) {
@@ -912,16 +912,16 @@ public class ShaderCode {
return false;
}
}
-
+
/**
* Default customization of this shader source code.
*
* Note: The shader source to be edit must be created using a mutable StringBuilder.
*
- * @param gl a GL context, which must have been made current once
+ * @param gl a GL context, which must have been made current once
* @param preludeVersion if true {@link GLContext#getGLSLVersionString()} is preluded, otherwise not.
- * @param addDefaultPrecision if true default precision source code line(s) are added, i.e.
- * {@link #es2_default_precision_vp}, {@link #es2_default_precision_fp},
+ * @param addDefaultPrecision if true default precision source code line(s) are added, i.e.
+ * {@link #es2_default_precision_vp}, {@link #es2_default_precision_fp},
* {@link #gl3_default_precision_vp_gp}, {@link #gl3_default_precision_fp} or none,
* depending on the {@link GLContext#getGLSLVersionNumber() GLSL version} being used.
* @return the index after the inserted data, maybe 0 if nothing has be inserted.
@@ -940,13 +940,13 @@ public class ShaderCode {
}
return pos;
}
-
+
/**
* Default customization of this shader source code.
*
* Note: The shader source to be edit must be created using a mutable StringBuilder.
*
- * @param gl a GL context, which must have been made current once
+ * @param gl a GL context, which must have been made current once
* @param preludeVersion if true {@link GLContext#getGLSLVersionString()} is preluded, otherwise not.
* @param esDefaultPrecision optional default precision source code line(s) preluded if not null and if {@link GL#isGLES()}.
* You may use {@link #es2_default_precision_fp} for fragment shader and {@link #es2_default_precision_vp} for vertex shader.
@@ -967,8 +967,8 @@ public class ShaderCode {
pos = addDefaultShaderPrecision(gl, pos);
}
return pos;
- }
-
+ }
+
//----------------------------------------------------------------------
// Internals only below this point
//
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
index 1337a7e2b..d737d6f4e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
@@ -37,7 +37,7 @@ import java.util.Iterator;
import java.io.PrintStream;
public class ShaderProgram {
-
+
public ShaderProgram() {
id = getNextID();
}
@@ -111,7 +111,7 @@ public class ShaderProgram {
/**
* Adds a new shader to this program.
- *
+ *
*
This command does not compile and attach the shader,
* use {@link #add(GL2ES2, ShaderCode)} for this purpose.
*/
@@ -122,7 +122,7 @@ public class ShaderProgram {
public synchronized boolean contains(ShaderCode shaderCode) {
return allShaderCode.contains(shaderCode);
}
-
+
/**
* Warning slow O(n) operation ..
* @param id
@@ -145,9 +145,9 @@ public class ShaderProgram {
/**
* Creates the empty GL program object using {@link GL2ES2#glCreateProgram()},
* if not already created.
- *
+ *
* @param gl
- * @return true if shader program is valid, i.e. not zero
+ * @return true if shader program is valid, i.e. not zero
*/
public synchronized final boolean init(GL2ES2 gl) {
if( 0 == shaderProgram ) {
@@ -155,12 +155,12 @@ public class ShaderProgram {
}
return 0 != shaderProgram;
}
-
+
/**
* Adds a new shader to a this non running program.
*
*
Compiles and attaches the shader, if not done yet.
- *
+ *
* @return true if the shader was successfully added, false if compilation failed.
*/
public synchronized boolean add(GL2ES2 gl, ShaderCode shaderCode, PrintStream verboseOut) {
@@ -179,11 +179,11 @@ public class ShaderProgram {
/**
* Replace a shader in a program and re-links the program.
*
- * @param gl
+ * @param gl
* @param oldShader the to be replace Shader
* @param newShader the new ShaderCode
* @param verboseOut the optional verbose output stream
- *
+ *
* @return true if all steps are valid, shader compilation, attachment and linking; otherwise false.
*
* @see ShaderState#glEnableVertexAttribArray
@@ -199,25 +199,25 @@ public class ShaderProgram {
if(!init(gl) || !newShader.compile(gl, verboseOut)) {
return false;
}
-
+
boolean shaderWasInUse = inUse();
if(shaderWasInUse) {
useProgram(gl, false);
}
-
+
if(null != oldShader && allShaderCode.remove(oldShader)) {
if(attachedShaderCode.remove(oldShader)) {
ShaderUtil.detachShader(gl, shaderProgram, oldShader.shader());
}
}
-
+
add(newShader);
if(attachedShaderCode.add(newShader)) {
ShaderUtil.attachShader(gl, shaderProgram, newShader.shader());
}
-
+
gl.glLinkProgram(shaderProgram);
-
+
programLinked = ShaderUtil.isProgramLinkStatusValid(gl, shaderProgram, System.err);
if ( programLinked && shaderWasInUse ) {
useProgram(gl, true);
@@ -227,19 +227,19 @@ public class ShaderProgram {
/**
* Links the shader code to the program.
- *
+ *
*
Compiles and attaches the shader code to the program if not done by yet
- *
+ *
*
Within this process, all GL resources (shader and program objects) are created if necessary.
- *
+ *
* @param gl
* @param verboseOut
* @return true if program was successfully linked and is valid, otherwise false
- *
+ *
* @see #init(GL2ES2)
*/
public synchronized boolean link(GL2ES2 gl, PrintStream verboseOut) {
- if( !init(gl) ) {
+ if( !init(gl) ) {
programLinked = false; // mark unlinked due to user attempt to [re]link
return false;
}
@@ -287,7 +287,7 @@ public class ShaderProgram {
sb.append("]");
return sb;
}
-
+
public String toString() {
return toString(null).toString();
}
@@ -299,7 +299,7 @@ public class ShaderProgram {
public synchronized boolean validateProgram(GL2ES2 gl, PrintStream verboseOut) {
return ShaderUtil.isProgramExecStatusValid(gl, shaderProgram, verboseOut);
}
-
+
public synchronized void useProgram(GL2ES2 gl, boolean on) {
if(!programLinked) { throw new GLException("Program is not linked"); }
if(programInUse==on) { return; }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
index 8e7781f07..f60cb6088 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
@@ -48,21 +48,21 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
* while updating the attribute and uniform locations when switching.
*
* This allows seamless switching of programs using almost same data
- * but performing different artifacts.
+ * but performing different artifacts.
*
*
* A {@link #useProgram(GL2ES2, boolean) used} ShaderState is attached to the current GL context
* and can be retrieved via {@link #getShaderState(GL)}.
*
*/
-public class ShaderState {
+public class ShaderState {
public static final boolean DEBUG;
-
+
static {
Debug.initSingleton();
DEBUG = Debug.isPropertyDefined("jogl.debug.GLSLState", true);
}
-
+
public ShaderState() {
}
@@ -80,7 +80,7 @@ public class ShaderState {
/**
* Attach user object for the given name to this ShaderState.
* Returns the previously set object or null.
- *
+ *
* @return the previous mapped object or null if none
*/
public final Object attachObject(String name, Object obj) {
@@ -89,13 +89,13 @@ public class ShaderState {
/**
* @param name name of the mapped object to detach
- *
+ *
* @return the previous mapped object or null if none
*/
public final Object detachObject(String name) {
return attachedObjectsByString.remove(name);
- }
-
+ }
+
/**
* Turns the shader program on or off.
*
@@ -104,7 +104,7 @@ public class ShaderState {
* @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
*/
public synchronized void useProgram(GL2ES2 gl, boolean on) throws GLException {
- if(null==shaderProgram) { throw new GLException("No program is attached"); }
+ if(null==shaderProgram) { throw new GLException("No program is attached"); }
if(on) {
if(shaderProgram.linked()) {
shaderProgram.useProgram(gl, true);
@@ -112,7 +112,7 @@ public class ShaderState {
resetAllAttributes(gl);
resetAllUniforms(gl);
}
- } else {
+ } else {
if(resetAllShaderData) {
setAllAttributes(gl);
}
@@ -124,7 +124,7 @@ public class ShaderState {
resetAllUniforms(gl);
}
}
- resetAllShaderData = false;
+ resetAllShaderData = false;
} else {
shaderProgram.useProgram(gl, false);
}
@@ -141,17 +141,17 @@ public class ShaderState {
/**
* Attach or switch a shader program
*
- *
Attaching a shader program the first time,
+ *
Attaching a shader program the first time,
* as well as switching to another program on the fly,
* while managing all attribute and uniform data.
- *
+ *
*
[Re]sets all data and use program in case of a program switch.
- *
+ *
*
Use program, {@link #useProgram(GL2ES2, boolean)},
* if enable is true.
- *
+ *
* @return true if shader program was attached, otherwise false (already attached)
- *
+ *
* @throws GLException if program was not linked and linking fails
*/
public synchronized boolean attachShaderProgram(GL2ES2 gl, ShaderProgram prog, boolean enable) throws GLException {
@@ -161,7 +161,7 @@ public class ShaderState {
System.err.println("ShaderState: attachShaderProgram: "+curId+" -> "+newId+" (enable: "+enable+")\n\t"+shaderProgram+"\n\t"+prog);
if(DEBUG) {
Thread.dumpStack();
- }
+ }
}
if(null!=shaderProgram) {
if(shaderProgram.equals(prog)) {
@@ -190,7 +190,7 @@ public class ShaderState {
shaderProgram = prog;
if(null!=shaderProgram) {
- // [re]set all data and use program if switching program,
+ // [re]set all data and use program if switching program,
// or use program if program is linked
if(resetAllShaderData || enable) {
useProgram(gl, true); // may reset all data
@@ -216,7 +216,7 @@ public class ShaderState {
*/
public synchronized void destroy(GL2ES2 gl) {
release(gl, true, true, true);
- attachedObjectsByString.clear();
+ attachedObjectsByString.clear();
}
/**
@@ -242,7 +242,7 @@ public class ShaderState {
if(destroyBoundAttributes) {
for(Iterator iter = managedAttributes.iterator(); iter.hasNext(); ) {
iter.next().destroy(gl);
- }
+ }
}
releaseAllAttributes(gl);
releaseAllUniforms(gl);
@@ -258,7 +258,7 @@ public class ShaderState {
/**
* Gets the cached location of a shader attribute.
*
- * @return -1 if there is no such attribute available,
+ * @return -1 if there is no such attribute available,
* otherwise >= 0
*
* @see #bindAttribLocation(GL2ES2, int, String)
@@ -270,7 +270,7 @@ public class ShaderState {
Integer idx = activeAttribLocationMap.get(name);
return (null!=idx)?idx.intValue():-1;
}
-
+
/**
* Get the previous cached vertex attribute data.
*
@@ -289,27 +289,27 @@ public class ShaderState {
public GLArrayData getAttribute(String name) {
return activeAttribDataMap.get(name);
}
-
+
public boolean isActiveAttribute(GLArrayData attribute) {
return attribute == activeAttribDataMap.get(attribute.getName());
}
-
+
/**
* Binds or unbinds the {@link GLArrayData} lifecycle to this ShaderState.
- *
+ *
*
If an attribute location is cached (ie {@link #bindAttribLocation(GL2ES2, int, String)})
* it is promoted to the {@link GLArrayData} instance.
- *
- *
The attribute will be destroyed with {@link #destroy(GL2ES2)}
+ *
+ *
The attribute will be destroyed with {@link #destroy(GL2ES2)}
* and it's location will be reset when switching shader with {@link #attachShaderProgram(GL2ES2, ShaderProgram)}.
- *
+ *
*
The data will not be transfered to the GPU, use {@link #vertexAttribPointer(GL2ES2, GLArrayData)} additionally.
- *
+ *
*
The data will also be {@link GLArrayData#associate(Object, boolean) associated} with this ShaderState.
- *
+ *
* @param attribute the {@link GLArrayData} which lifecycle shall be managed
* @param own true if owning shall be performs, false if disowning.
- *
+ *
* @see #bindAttribLocation(GL2ES2, int, String)
* @see #getAttribute(String)
* @see GLArrayData#associate(Object, boolean)
@@ -326,11 +326,11 @@ public class ShaderState {
}
attribute.associate(this, own);
}
-
+
public boolean ownsAttribute(GLArrayData attribute) {
return managedAttributes.contains(attribute);
}
-
+
/**
* Binds a shader attribute to a location.
* Multiple names can be bound to one location.
@@ -339,14 +339,14 @@ public class ShaderState {
*
* @throws GLException if no program is attached
* @throws GLException if the program is already linked
- *
+ *
* @see javax.media.opengl.GL2ES2#glBindAttribLocation(int, int, String)
* @see #getAttribLocation(GL2ES2, String)
* @see #getCachedAttribLocation(String)
*/
public void bindAttribLocation(GL2ES2 gl, int location, String name) {
if(null==shaderProgram) throw new GLException("No program is attached");
- if(shaderProgram.linked()) throw new GLException("Program is already linked");
+ if(shaderProgram.linked()) throw new GLException("Program is already linked");
final Integer loc = new Integer(location);
activeAttribLocationMap.put(name, loc);
gl.glBindAttribLocation(shaderProgram.program(), location, name);
@@ -361,7 +361,7 @@ public class ShaderState {
*
* @throws GLException if no program is attached
* @throws GLException if the program is already linked
- *
+ *
* @see javax.media.opengl.GL2ES2#glBindAttribLocation(int, int, String)
* @see #getAttribLocation(GL2ES2, String)
* @see #getCachedAttribLocation(String)
@@ -382,7 +382,7 @@ public class ShaderState {
* or the GLSL queried via {@link GL2ES2#glGetAttribLocation(int, String)}.
* The location will be cached.
*
- * @return -1 if there is no such attribute available,
+ * @return -1 if there is no such attribute available,
* otherwise >= 0
* @throws GLException if no program is attached
* @throws GLException if the program is not linked and no location was cached.
@@ -407,22 +407,22 @@ public class ShaderState {
System.err.println("ShaderState: glGetAttribLocation failed, no location for: "+name+", loc: "+location);
if(DEBUG) {
Thread.dumpStack();
- }
+ }
}
}
return location;
}
-
+
/**
* Validates and returns the location of a shader attribute.
- * Uses either the cached value {@link #getCachedAttribLocation(String)} if valid,
+ * Uses either the cached value {@link #getCachedAttribLocation(String)} if valid,
* or the GLSL queried via {@link GL2ES2#glGetAttribLocation(int, String)}.
- * The location will be cached and set in the
+ * The location will be cached and set in the
* {@link GLArrayData} object.
*
- * @return -1 if there is no such attribute available,
+ * @return -1 if there is no such attribute available,
* otherwise >= 0
- *
+ *
* @throws GLException if no program is attached
* @throws GLException if the program is not linked and no location was cached.
*
@@ -451,13 +451,13 @@ public class ShaderState {
System.err.println("ShaderState: glGetAttribLocation failed, no location for: "+name+", loc: "+location);
if(DEBUG) {
Thread.dumpStack();
- }
+ }
}
- }
+ }
activeAttribDataMap.put(data.getName(), data);
return location;
}
-
+
//
// Enabled Vertex Arrays and its data
//
@@ -469,14 +469,14 @@ public class ShaderState {
final Boolean v = activedAttribEnabledMap.get(name);
return null != v && v.booleanValue();
}
-
+
/**
* @return true if the {@link GLArrayData} attribute is enable
*/
public final boolean isVertexAttribArrayEnabled(GLArrayData data) {
return isVertexAttribArrayEnabled(data.getName());
}
-
+
private boolean enableVertexAttribArray(GL2ES2 gl, String name, int location) {
activedAttribEnabledMap.put(name, Boolean.TRUE);
if(0>location) {
@@ -486,7 +486,7 @@ public class ShaderState {
System.err.println("ShaderState: glEnableVertexAttribArray failed, no index for: "+name);
if(DEBUG) {
Thread.dumpStack();
- }
+ }
}
return false;
}
@@ -497,12 +497,12 @@ public class ShaderState {
gl.glEnableVertexAttribArray(location);
return true;
}
-
+
/**
* Enables a vertex attribute array.
- *
+ *
* This method retrieves the the location via {@link #getAttribLocation(GL2ES2, GLArrayData)}
- * hence {@link #enableVertexAttribArray(GL2ES2, GLArrayData)} shall be preferred.
+ * hence {@link #enableVertexAttribArray(GL2ES2, GLArrayData)} shall be preferred.
*
* Even if the attribute is not found in the current shader,
* it is marked enabled in this state.
@@ -510,7 +510,7 @@ public class ShaderState {
* @return false, if the name is not found, otherwise true
*
* @throws GLException if the program is not linked and no location was cached.
- *
+ *
* @see #glEnableVertexAttribArray
* @see #glDisableVertexAttribArray
* @see #glVertexAttribPointer
@@ -519,7 +519,7 @@ public class ShaderState {
public boolean enableVertexAttribArray(GL2ES2 gl, String name) {
return enableVertexAttribArray(gl, name, -1);
}
-
+
/**
* Enables a vertex attribute array, usually invoked by {@link GLArrayDataEditable#enableBuffer(GL, boolean)}.
@@ -528,7 +528,7 @@ public class ShaderState {
* and is the preferred alternative to {@link #enableVertexAttribArray(GL2ES2, String)}.
* If data location is unset it will be retrieved via {@link #getAttribLocation(GL2ES2, GLArrayData)} set
* and cached in this state.
- *
+ *
* Even if the attribute is not found in the current shader,
* it is marked enabled in this state.
*
@@ -547,11 +547,11 @@ public class ShaderState {
getAttribLocation(gl, data);
} else {
// ensure data is the current bound one
- activeAttribDataMap.put(data.getName(), data);
+ activeAttribDataMap.put(data.getName(), data);
}
return enableVertexAttribArray(gl, data.getName(), data.getLocation());
}
-
+
private boolean disableVertexAttribArray(GL2ES2 gl, String name, int location) {
activedAttribEnabledMap.put(name, Boolean.FALSE);
if(0>location) {
@@ -572,13 +572,13 @@ public class ShaderState {
gl.glDisableVertexAttribArray(location);
return true;
}
-
+
/**
* Disables a vertex attribute array
*
* This method retrieves the the location via {@link #getAttribLocation(GL2ES2, GLArrayData)}
* hence {@link #disableVertexAttribArray(GL2ES2, GLArrayData)} shall be preferred.
- *
+ *
* Even if the attribute is not found in the current shader,
* it is removed from this state enabled list.
*
@@ -603,7 +603,7 @@ public class ShaderState {
* and is the preferred alternative to {@link #disableVertexAttribArray(GL2ES2, String)}.
* If data location is unset it will be retrieved via {@link #getAttribLocation(GL2ES2, GLArrayData)} set
* and cached in this state.
- *
+ *
* Even if the attribute is not found in the current shader,
* it is removed from this state enabled list.
*
@@ -623,20 +623,20 @@ public class ShaderState {
}
return disableVertexAttribArray(gl, data.getName(), data.getLocation());
}
-
+
/**
* Set the {@link GLArrayData} vertex attribute data, if it's location is valid, i.e. ≥ 0.
*
* This method uses the {@link GLArrayData}'s location if valid, i.e. ≥ 0.
- * If data's location is invalid, it will be retrieved via {@link #getAttribLocation(GL2ES2, GLArrayData)},
+ * If data's location is invalid, it will be retrieved via {@link #getAttribLocation(GL2ES2, GLArrayData)},
* set and cached in this state.
*
- *
+ *
* @return false, if the location could not be determined, otherwise true
*
* @throws GLException if no program is attached
* @throws GLException if the program is not linked and no location was cached.
- *
+ *
* @see #glEnableVertexAttribArray
* @see #glDisableVertexAttribArray
* @see #glVertexAttribPointer
@@ -646,7 +646,7 @@ public class ShaderState {
int location = data.getLocation();
if(0 > location) {
location = getAttribLocation(gl, data);
- }
+ }
if(0 <= location) {
// only pass the data, if the attribute exists in the current shader
if(DEBUG) {
@@ -683,16 +683,16 @@ public class ShaderState {
activeAttribDataMap.clear();
activedAttribEnabledMap.clear();
activeAttribLocationMap.clear();
- managedAttributes.clear();
+ managedAttributes.clear();
}
-
+
/**
* Disables all vertex attribute arrays.
*
* Their enabled stated will be removed from this state only
* if 'removeFromState' is true.
*
- * This method purpose is more for debugging.
+ * This method purpose is more for debugging.
*
* @see #glEnableVertexAttribArray
* @see #glDisableVertexAttribArray
@@ -717,7 +717,7 @@ public class ShaderState {
}
private final void relocateAttribute(GL2ES2 gl, GLArrayData attribute) {
- // get new location .. note: 'activeAttribLocationMap' is cleared before
+ // get new location .. note: 'activeAttribLocationMap' is cleared before
final String name = attribute.getName();
final int loc = attribute.setLocation(gl, shaderProgram.program());
if(0<=loc) {
@@ -729,34 +729,34 @@ public class ShaderState {
// enable attrib, VBO and pass location/data
gl.glEnableVertexAttribArray(loc);
}
-
+
if( attribute.isVBO() ) {
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, attribute.getVBOName());
gl.glVertexAttribPointer(attribute);
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
- } else {
+ } else {
gl.glVertexAttribPointer(attribute);
}
}
}
-
+
/**
* Reset all previously enabled mapped vertex attribute data.
- *
+ *
*
* Attribute data is bound to the GL state, i.e. VBO data itself will not be updated.
*
- *
+ *
*
* Attribute location and it's data assignment is bound to the program,
* hence both are updated.
*
- *
+ *
*
- * Note: Such update could only be prevented,
+ * Note: Such update could only be prevented,
* if tracking am attribute/program dirty flag.
*
- *
+ *
* @throws GLException is the program is not linked
*
* @see #attachShaderProgram(GL2ES2, ShaderProgram)
@@ -764,7 +764,7 @@ public class ShaderState {
private final void resetAllAttributes(GL2ES2 gl) {
if(!shaderProgram.linked()) throw new GLException("Program is not linked");
activeAttribLocationMap.clear();
-
+
for(int i=0; i= 0
*/
public final int getCachedUniformLocation(String name) {
@@ -822,38 +822,38 @@ public class ShaderState {
/**
* Bind the {@link GLUniform} lifecycle to this ShaderState.
- *
+ *
*
If a uniform location is cached it is promoted to the {@link GLUniformData} instance.
- *
- *
The attribute will be destroyed with {@link #destroy(GL2ES2)}
+ *
+ *
The attribute will be destroyed with {@link #destroy(GL2ES2)}
* and it's location will be reset when switching shader with {@link #attachShaderProgram(GL2ES2, ShaderProgram)}.
- *
+ *
*
The data will not be transfered to the GPU, use {@link #uniform(GL2ES2, GLUniformData)} additionally.
- *
+ *
* @param uniform the {@link GLUniformData} which lifecycle shall be managed
- *
+ *
* @see #getUniform(String)
*/
public void ownUniform(GLUniformData uniform) {
final int location = getCachedUniformLocation(uniform.getName());
if(0<=location) {
uniform.setLocation(location);
- }
+ }
activeUniformDataMap.put(uniform.getName(), uniform);
- managedUniforms.add(uniform);
+ managedUniforms.add(uniform);
}
-
+
public boolean ownsUniform(GLUniformData uniform) {
return managedUniforms.contains(uniform);
}
-
+
/**
* Gets the location of a shader uniform with given name.
* Uses either the cached value {@link #getCachedUniformLocation(String)} if valid,
* or the GLSL queried via {@link GL2ES2#glGetUniformLocation(int, String)}.
* The location will be cached.
*
- * The current shader program ({@link #attachShaderProgram(GL2ES2, ShaderProgram)})
+ * The current shader program ({@link #attachShaderProgram(GL2ES2, ShaderProgram)})
* must be in use ({@link #useProgram(GL2ES2, boolean) }) !
*
* @return -1 if there is no such attribute available,
@@ -884,15 +884,15 @@ public class ShaderState {
}
return location;
}
-
+
/**
* Validates and returns the location of a shader uniform.
* Uses either the cached value {@link #getCachedUniformLocation(String)} if valid,
* or the GLSL queried via {@link GL2ES2#glGetUniformLocation(int, String)}.
- * The location will be cached and set in the
+ * The location will be cached and set in the
* {@link GLUniformData} object.
*
- * The current shader program ({@link #attachShaderProgram(GL2ES2, ShaderProgram)})
+ * The current shader program ({@link #attachShaderProgram(GL2ES2, ShaderProgram)})
* must be in use ({@link #useProgram(GL2ES2, boolean) }) !
*
* @return -1 if there is no such attribute available,
@@ -922,16 +922,16 @@ public class ShaderState {
Thread.dumpStack();
}
}
- }
- activeUniformDataMap.put(name, data);
+ }
+ activeUniformDataMap.put(name, data);
return location;
}
-
+
/**
* Set the uniform data, if it's location is valid, i.e. ≥ 0.
*
* This method uses the {@link GLUniformData}'s location if valid, i.e. ≥ 0.
- * If data's location is invalid, it will be retrieved via {@link #getUniformLocation(GL2ES2, GLUniformData)},
+ * If data's location is invalid, it will be retrieved via {@link #getUniformLocation(GL2ES2, GLUniformData)},
* set and cached in this state.
*
*
@@ -959,7 +959,7 @@ public class ShaderState {
}
return false;
}
-
+
/**
* Get the uniform data, previously set.
*
@@ -978,7 +978,7 @@ public class ShaderState {
activeUniformLocationMap.clear();
managedUniforms.clear();
}
-
+
/**
* Reset all previously mapped uniform data
*
@@ -986,20 +986,20 @@ public class ShaderState {
* hence both are updated.
*
*
- * Note: Such update could only be prevented,
+ * Note: Such update could only be prevented,
* if tracking a uniform/program dirty flag.
*
- *
+ *
* @throws GLException is the program is not in use
- *
+ *
* @see #attachShaderProgram(GL2ES2, ShaderProgram)
*/
private final void resetAllUniforms(GL2ES2 gl) {
- if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
activeUniformLocationMap.clear();
for(Iterator iter = managedUniforms.iterator(); iter.hasNext(); ) {
iter.next().setLocation(-1);
- }
+ }
for(Iterator iter = activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
final GLUniformData data = iter.next();
final int loc = data.setLocation(gl, shaderProgram.program());
@@ -1018,9 +1018,9 @@ public class ShaderState {
if(null==sb) {
sb = new StringBuilder();
}
-
+
sb.append("ShaderState[ ");
-
+
sb.append(Platform.getNewline()).append(" ");
if(null != shaderProgram) {
shaderProgram.toString(sb);
@@ -1066,25 +1066,25 @@ public class ShaderState {
sb.append(Platform.getNewline()).append(" ]").append(Platform.getNewline()).append("]");
return sb;
}
-
+
@Override
public String toString() {
return toString(null, DEBUG).toString();
}
-
+
private boolean verbose = DEBUG;
private ShaderProgram shaderProgram=null;
-
+
private HashMap activedAttribEnabledMap = new HashMap();
private HashMap activeAttribLocationMap = new HashMap();
private HashMap activeAttribDataMap = new HashMap();
private ArrayList managedAttributes = new ArrayList();
-
+
private HashMap activeUniformLocationMap = new HashMap();
private HashMap activeUniformDataMap = new HashMap();
private ArrayList managedUniforms = new ArrayList();
-
- private HashMap attachedObjectsByString = new HashMap();
+
+ private HashMap attachedObjectsByString = new HashMap();
private boolean resetAllShaderData = false;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
index d18fd4bae..5cd384c58 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2009 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,7 +28,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 com.jogamp.opengl.util.glsl;
@@ -117,11 +117,11 @@ public class ShaderUtil {
}
return true;
}
-
+
/**
* Performs {@link GL2ES2#glValidateProgram(int)}
*
- * One shall only call this method while debugging and only if all required
+ * One shall only call this method while debugging and only if all required
* resources by the shader are set.
*
*
@@ -150,7 +150,7 @@ public class ShaderUtil {
}
/**
- * If supported, queries the natively supported shader binary formats using
+ * If supported, queries the natively supported shader binary formats using
* {@link GL2ES2#GL_NUM_SHADER_BINARY_FORMATS} and {@link GL2ES2#GL_SHADER_BINARY_FORMATS}
* via {@link GL2ES2#glGetIntegerv(int, int[], int)}.
*/
@@ -172,9 +172,9 @@ public class ShaderUtil {
info.shaderBinaryFormats.add(new Integer(formats[i]));
}
}
- } catch (GLException gle) {
- System.err.println("Catched Exception on thread "+Thread.currentThread().getName());
- gle.printStackTrace();
+ } catch (GLException gle) {
+ System.err.println("Catched Exception on thread "+Thread.currentThread().getName());
+ gle.printStackTrace();
}
}
}
@@ -202,13 +202,13 @@ public class ShaderUtil {
}
info.shaderCompilerAvailable = new Boolean(v);
queryOK = true;
- } catch (GLException gle) {
- System.err.println("Catched Exception on thread "+Thread.currentThread().getName());
- gle.printStackTrace();
+ } catch (GLException gle) {
+ System.err.println("Catched Exception on thread "+Thread.currentThread().getName());
+ gle.printStackTrace();
}
if(!queryOK) {
info.shaderCompilerAvailable = new Boolean(true);
- }
+ }
} else if( gl.isGL2ES2() ) {
info.shaderCompilerAvailable = new Boolean(true);
} else {
@@ -217,8 +217,8 @@ public class ShaderUtil {
}
return info.shaderCompilerAvailable.booleanValue();
}
-
- /** Returns true if GeometryShader is supported, i.e. whether GLContext is ≥ 3.2 or ARB_geometry_shader4 extension is available. */
+
+ /** Returns true if GeometryShader is supported, i.e. whether GLContext is ≥ 3.2 or ARB_geometry_shader4 extension is available. */
public static boolean isGeometryShaderSupported(GL _gl) {
final GLContext ctx = _gl.getContext();
return ctx.getGLVersionNumber().compareTo(GLContext.Version320) >= 0 ||
@@ -240,7 +240,7 @@ public class ShaderUtil {
IntBuffer lengths = Buffers.newDirectIntBuffer(count);
for(int i=0; i shaderBinaryFormats = null;
- }
+ }
private static ProfileInformation getProfileInformation(GL gl) {
final GLContext context = gl.getContext();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
index a653bd467..2f8884a3a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
@@ -24,13 +24,13 @@ import com.jogamp.opengl.util.PMVMatrix;
public class FixedFuncUtil {
/**
* @param gl
- * @param mode one of the {@link ShaderSelectionMode}s
+ * @param mode one of the {@link ShaderSelectionMode}s
* @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
* @return If gl is a GL2ES1 and force is false, return the type cast object,
* otherwise create a fixed function emulation pipeline using the given GL2ES2 impl
* and hook it to the GLContext via {@link GLContext#setGL(GL)}.
* @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
- *
+ *
* @see ShaderSelectionMode#AUTO
* @see ShaderSelectionMode#COLOR
* @see ShaderSelectionMode#COLOR_LIGHT_PER_VERTEX
@@ -53,13 +53,13 @@ public class FixedFuncUtil {
/**
* @param gl
- * @param mode one of the {@link ShaderSelectionMode}s
+ * @param mode one of the {@link ShaderSelectionMode}s
* @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
* @return If gl is a GL2ES1, return the type cast object,
* otherwise create a fixed function emulation pipeline using the GL2ES2 impl.
* and hook it to the GLContext via {@link GLContext#setGL(GL)}.
* @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
- *
+ *
* @see ShaderSelectionMode#AUTO
* @see ShaderSelectionMode#COLOR
* @see ShaderSelectionMode#COLOR_LIGHT_PER_VERTEX
@@ -71,11 +71,11 @@ public class FixedFuncUtil {
}
/**
- * Mapping fixed function (client) array indices to
+ * Mapping fixed function (client) array indices to
* GLSL array attribute names.
*
* Useful for uniq mapping of canonical array index names as listed.
- *
+ *
* @see #mgl_Vertex
* @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_VERTEX_ARRAY
* @see #mgl_Normal
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/ShaderSelectionMode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/ShaderSelectionMode.java
index e6bdf702c..426fb0d85 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/ShaderSelectionMode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/ShaderSelectionMode.java
@@ -1,8 +1,8 @@
package com.jogamp.opengl.util.glsl.fixedfunc;
-/**
+/**
* Shader selection mode
- *
+ *
* @see ShaderSelectionMode#AUTO
* @see ShaderSelectionMode#COLOR
* @see ShaderSelectionMode#COLOR_LIGHT_PER_VERTEX
@@ -11,17 +11,17 @@ package com.jogamp.opengl.util.glsl.fixedfunc;
*/
public enum ShaderSelectionMode {
/** Auto shader selection, based upon FFP states. */
- AUTO,
+ AUTO,
/** Fixed shader selection: Simple color. */
- COLOR,
+ COLOR,
/** Fixed shader selection: Multi-Textured color. 2 texture units. */
- COLOR_TEXTURE2,
+ COLOR_TEXTURE2,
/** Fixed shader selection: Multi-Textured color. 4 texture units. */
- COLOR_TEXTURE4,
+ COLOR_TEXTURE4,
/** Fixed shader selection: Multi-Textured color. 8 texture units. */
- COLOR_TEXTURE8,
+ COLOR_TEXTURE8,
/** Fixed shader selection: Color with vertex-lighting. */
- COLOR_LIGHT_PER_VERTEX,
+ COLOR_LIGHT_PER_VERTEX,
/** Fixed shader selection: Multi-Textured color with vertex-lighting. 8 texture units.*/
- COLOR_TEXTURE8_LIGHT_PER_VERTEX
+ COLOR_TEXTURE8_LIGHT_PER_VERTEX
}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
index a5b1c6687..9573ea5c3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
@@ -55,8 +55,8 @@ public abstract class CompileShader {
URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
String dirName = dirname(resourceURL.getPath());
- outName = dirName + File.separator + "bin" + File.separator +
- ShaderCode.getBinarySubPath(getBinaryFormat()) + File.separator +
+ outName = dirName + File.separator + "bin" + File.separator +
+ ShaderCode.getBinarySubPath(getBinaryFormat()) + File.separator +
outName;
processOneShader(resourceName, outName, type);
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java
index 7b6a1b479..c1b5025f8 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
index 5ba3f7330..44b4fea9e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.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.
*/
@@ -128,7 +128,7 @@ public class Level {
candidate.setSize(candidate.w() - rect.w(), height);
freeList.add(candidate);
}
-
+
coalesceFreeList();
return true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
index 6783aec3b..e14eef5ba 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.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.
*/
@@ -108,7 +108,7 @@ public class LevelSet {
if (level.remove(rect))
return true;
}
-
+
return false;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
index 6206c4a11..23f143b83 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.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.
*/
@@ -72,7 +72,7 @@ public class Rect {
// there is no room left due either to fragmentation or just being
// out of space)
private Rect nextLocation;
-
+
public Rect() {
this(null);
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java
index 49cfc82e6..5db216742 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
index 1496a04a6..a9d609745 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.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.
*/
@@ -203,7 +203,7 @@ public class RectanglePacker {
}
nextLevelSet = new LevelSet(newWidth, newHeight);
-
+
// Make copies of all existing rectangles
List/**/ newRects = new ArrayList/**/();
for (Iterator i1 = levels.iterator(); i1.hasNext(); ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
index 4236e22fb..fd026d76e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 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.
@@ -53,8 +53,8 @@ import com.jogamp.opengl.util.texture.spi.*;
* for enabling/disabling OpenGL texture state, binding this texture,
* and computing texture coordinates for both the entire image as well
* as a sub-image.
- *
- *
* Due to many confusions w/ texture usage, following list described the order
* and semantics of texture unit selection, binding and enabling.
@@ -67,16 +67,16 @@ import com.jogamp.opengl.util.texture.spi.*;
*
Issue draw commands
*
*
- *
+ *
*
Non-power-of-two restrictions
* When creating an OpenGL texture object, the Texture class will
* attempt to use non-power-of-two textures (NPOT) if available, see {@link GL#isNPOTTextureAvailable()}.
- * Further more,
+ * Further more,
* GL_ARB_texture_rectangle
* (RECT) will be attempted on OSX w/ ATI drivers.
* If NPOT is not available or RECT not chosen, the Texture class will simply upload a non-pow2-sized
* image into a standard pow2-sized texture (without any special
- * scaling).
+ * scaling).
* Since the choice of extension (or whether one is used at
* all) depends on the user's machine configuration, developers are
* recommended to use {@link #getImageTexCoords} and {@link
@@ -106,7 +106,7 @@ import com.jogamp.opengl.util.texture.spi.*;
* #bind}, but when drawing many triangles all using the same texture,
* for best performance only one call to {@link #bind} should be made.
* User may also utilize multiple texture units,
- * see order of texture commands above.
+ * see order of texture commands above.
*
*
* The mathematically correct way to perform blending in OpenGL
* with the SrcOver "source over destination" mode, or any other
- * Porter-Duff rule, is to use premultiplied color components,
+ * Porter-Duff rule, is to use premultiplied color components,
* which means the R/G/ B color components must have been multiplied by
* the alpha value. If using premultiplied color components
* it is important to use the correct blending function; for
@@ -137,7 +137,7 @@ import com.jogamp.opengl.util.texture.spi.*;
float g = g * a;
float b = b * a;
gl.glColor4f(r, g, b, a);
-
+
*
* For reference, here is a list of the Porter-Duff compositing rules
* and the associated OpenGL blend functions (source and destination
@@ -187,8 +187,8 @@ public class Texture {
/** The texture coordinates corresponding to the entire image. */
private TextureCoords coords;
-
- public String toString() {
+
+ public String toString() {
return "Texture[target 0x"+Integer.toHexString(target)+", name "+texID+", "+
imgWidth+"/"+texWidth+" x "+imgHeight+"/"+texHeight+", y-flip "+mustFlipVertically+
", "+estimatedMemorySize+" bytes]";
@@ -237,7 +237,7 @@ public class Texture {
* gl.glEnable(texture.getTarget());
*
*
- * Call is ignored if the {@link GL} object's context
+ * Call is ignored if the {@link GL} object's context
* is using a core profile, see {@link GL#isGLcore()},
* or if {@link #getTarget()} is {@link GLES2#GL_TEXTURE_EXTERNAL_OES}.
*
@@ -255,7 +255,7 @@ public class Texture {
gl.glEnable(target);
}
}
-
+
/**
* Disables this texture's target (e.g., GL_TEXTURE_2D) in the
* given GL state. This method is a shorthand equivalent
@@ -264,7 +264,7 @@ public class Texture {
* gl.glDisable(texture.getTarget());
*
*
- * Call is ignored if the {@link GL} object's context
+ * Call is ignored if the {@link GL} object's context
* is using a core profile, see {@link GL#isGLcore()},
* or if {@link #getTarget()} is {@link GLES2#GL_TEXTURE_EXTERNAL_OES}.
*
@@ -282,7 +282,7 @@ public class Texture {
gl.glDisable(target);
}
}
-
+
/**
* Binds this texture to the given GL context. This method is a
* shorthand equivalent of the following OpenGL code:
@@ -292,16 +292,16 @@ public class Texture {
*
* See the performance tips above for hints
* on how to maximize performance when using many Texture objects.
- *
+ *
* @param gl the current GL context
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
public void bind(GL gl) throws GLException {
validateTexID(gl, true);
- gl.glBindTexture(target, texID);
+ gl.glBindTexture(target, texID);
}
-
+
/**
* Destroys the native resources used by this texture object.
*
@@ -335,7 +335,7 @@ public class Texture {
public int getWidth() {
return texWidth;
}
-
+
/**
* Returns the height of the allocated OpenGL texture in pixels.
* Note that the texture height will be greater than or equal to the
@@ -345,9 +345,9 @@ public class Texture {
*/
public int getHeight() {
return texHeight;
- }
-
- /**
+ }
+
+ /**
* Returns the width of the image contained within this texture.
* Note that for non-power-of-two textures in particular this may
* not be equal to the result of {@link #getWidth}. It is
@@ -389,7 +389,7 @@ public class Texture {
* entire image. If the TextureData indicated that the texture
* coordinates must be flipped vertically, the returned
* TextureCoords will take that into account.
- *
+ *
* @return the texture coordinates corresponding to the entire image
*/
public TextureCoords getImageTexCoords() {
@@ -406,7 +406,7 @@ public class Texture {
* flipped vertically, the returned TextureCoords will take that
* into account; this should not be handled by the end user in the
* specification of the y1 and y2 coordinates.
- *
+ *
* @return the texture coordinates corresponding to the specified sub-image
*/
public TextureCoords getSubImageTexCoords(int x1, int y1, int x2, int y2) {
@@ -431,9 +431,9 @@ public class Texture {
}
/**
- * Updates the entire content area incl. {@link TextureCoords}
+ * Updates the entire content area incl. {@link TextureCoords}
* of this texture using the data in the given image.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void updateImage(GL gl, TextureData data) throws GLException {
@@ -465,12 +465,12 @@ public class Texture {
updateTexCoords();
}
}
-
+
/**
* Updates the content area incl. {@link TextureCoords} of the specified target of this texture
* using the data in the given image. In general this is intended
* for construction of cube maps.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void updateImage(GL gl, TextureData data, int targetOverride) throws GLException {
@@ -791,7 +791,7 @@ public class Texture {
* texture's target. This gives control over parameters such as
* GL_TEXTURE_MAX_ANISOTROPY_EXT. Causes this texture to be bound to
* the current texture state.
- *
+ *
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
@@ -805,7 +805,7 @@ public class Texture {
* Sets the OpenGL multi-floating-point texture parameter for the
* texture's target. Causes this texture to be bound to the current
* texture state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameterfv(GL gl, int parameterName,
@@ -818,7 +818,7 @@ public class Texture {
* Sets the OpenGL multi-floating-point texture parameter for the
* texture's target. Causes this texture to be bound to the current
* texture state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameterfv(GL gl, int parameterName,
@@ -834,7 +834,7 @@ public class Texture {
* to GL_CLAMP_TO_EDGE if OpenGL 1.2 is supported on the current
* platform and GL_CLAMP if not. Causes this texture to be bound to
* the current texture state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameteri(GL gl, int parameterName,
@@ -847,7 +847,7 @@ public class Texture {
* Sets the OpenGL multi-integer texture parameter for the texture's
* target. Causes this texture to be bound to the current texture
* state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameteriv(GL gl, int parameterName,
@@ -860,7 +860,7 @@ public class Texture {
* Sets the OpenGL multi-integer texture parameter for the texture's
* target. Causes this texture to be bound to the current texture
* state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameteriv(GL gl, int parameterName,
@@ -886,7 +886,7 @@ public class Texture {
}
/**
- * Returns the underlying OpenGL texture object for this texture,
+ * Returns the underlying OpenGL texture object for this texture,
* maybe 0 if not yet generated.
*
* Most applications will not need to access this, since it is
@@ -967,19 +967,19 @@ public class Texture {
}
} else {
if (mustFlipVertically) {
- coords = new TextureCoords(0, // l
+ coords = new TextureCoords(0, // l
(float) imgHeight / (float) texHeight, // b
(float) imgWidth / (float) texWidth, // r
0 // t
);
} else {
- coords = new TextureCoords(0, // l
+ coords = new TextureCoords(0, // l
0, // b
(float) imgWidth / (float) texWidth, // r
(float) imgHeight / (float) texHeight // t
);
}
- }
+ }
}
private void updateSubImageImpl(GL gl, TextureData data, int newTarget, int mipmapLevel,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
index 3931b7290..63f100630 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 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,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.
@@ -77,7 +77,7 @@ public class TextureCoords {
d[6+d_off] = right *ss; d[7+d_off] = top *ts;
return d;
}
-
+
/** Returns the leftmost (x) texture coordinate of this
rectangle. */
public float left() { return left; }
@@ -93,6 +93,6 @@ public class TextureCoords {
/** Returns the topmost (y) texture coordinate of this
rectangle. */
public float top() { return top; }
-
+
public String toString() { return "TexCoord[h: "+left+" - "+right+", v: "+bottom+" - "+top+"]"; }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
index afc5bf70c..28029efc5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 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.
@@ -57,8 +57,8 @@ import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
public class TextureData {
/** ColorSpace of pixel data. */
- public static enum ColorSpace { RGB, YCbCr, YCCK, CMYK };
-
+ public static enum ColorSpace { RGB, YCbCr, YCCK, CMYK };
+
protected int width;
protected int height;
private int border;
@@ -83,7 +83,7 @@ public class TextureData {
protected GLProfile glProfile;
protected ColorSpace pixelCS = ColorSpace.RGB;
- /**
+ /**
* Constructs a new TextureData object with the specified parameters
* and data contained in the given Buffer. The optional Flusher can
* be used to clean up native resources associated with this
@@ -123,7 +123,7 @@ public class TextureData {
* data were invalid, such as requesting mipmap generation for a
* compressed texture
*/
- public TextureData(GLProfile glp,
+ public TextureData(GLProfile glp,
int internalFormat,
int width,
int height,
@@ -135,11 +135,11 @@ public class TextureData {
boolean mustFlipVertically,
Buffer buffer,
Flusher flusher) throws IllegalArgumentException {
- this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
+ this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
mipmap, dataIsCompressed, mustFlipVertically, buffer, flusher);
}
- /**
+ /**
* Constructs a new TextureData object with the specified parameters
* and data contained in the given Buffer. The optional Flusher can
* be used to clean up native resources associated with this
@@ -178,7 +178,7 @@ public class TextureData {
* data were invalid, such as requesting mipmap generation for a
* compressed texture
*/
- public TextureData(GLProfile glp,
+ public TextureData(GLProfile glp,
int internalFormat,
int width,
int height,
@@ -207,8 +207,8 @@ public class TextureData {
alignment = 1; // FIXME: is this correct enough in all situations?
estimatedMemorySize = estimatedMemorySize(buffer);
}
-
- /**
+
+ /**
* Constructs a new TextureData object with the specified parameters
* and data for multiple mipmap levels contained in the given array
* of Buffers. The optional Flusher can be used to clean up native
@@ -258,11 +258,11 @@ public class TextureData {
boolean mustFlipVertically,
Buffer[] mipmapData,
Flusher flusher) throws IllegalArgumentException {
- this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
+ this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
dataIsCompressed, mustFlipVertically, mipmapData, flusher);
}
- /**
+ /**
* Constructs a new TextureData object with the specified parameters
* and data for multiple mipmap levels contained in the given array
* of Buffers. The optional Flusher can be used to clean up native
@@ -325,19 +325,19 @@ public class TextureData {
estimatedMemorySize += estimatedMemorySize(mipmapData[i]);
}
}
-
- /**
+
+ /**
* Returns the color space of the pixel data.
- * @see #setColorSpace(ColorSpace)
+ * @see #setColorSpace(ColorSpace)
*/
public ColorSpace getColorSpace() { return pixelCS; }
- /**
+ /**
* Set the color space of the pixel data, which defaults to {@link ColorSpace#RGB}.
- * @see #getColorSpace()
+ * @see #getColorSpace()
*/
public void setColorSpace(ColorSpace cs) { pixelCS = cs; }
-
+
/** Used only by subclasses */
protected TextureData(GLProfile glp) { this.glProfile = glp; this.pixelAttributes = GLPixelAttributes.UNDEF; }
@@ -346,8 +346,8 @@ public class TextureData {
/** Returns the height in pixels of the texture data. */
public int getHeight() { return height; }
/** Returns the border in pixels of the texture data. */
- public int getBorder() {
- return border;
+ public int getBorder() {
+ return border;
}
/** Returns the intended OpenGL {@link GLPixelAttributes} of the texture data, i.e. format and type. */
public GLPixelAttributes getPixelAttributes() {
@@ -362,21 +362,21 @@ public class TextureData {
return pixelAttributes.type;
}
/** Returns the intended OpenGL internal format of the texture data. */
- public int getInternalFormat() {
- return internalFormat;
+ public int getInternalFormat() {
+ return internalFormat;
}
/** Returns whether mipmaps should be generated for the texture data. */
- public boolean getMipmap() {
- return mipmap;
+ public boolean getMipmap() {
+ return mipmap;
}
/** Indicates whether the texture data is in compressed form. */
- public boolean isDataCompressed() {
- return dataIsCompressed;
+ public boolean isDataCompressed() {
+ return dataIsCompressed;
}
/** Indicates whether the texture coordinates must be flipped
vertically for proper display. */
- public boolean getMustFlipVertically() {
- return mustFlipVertically;
+ public boolean getMustFlipVertically() {
+ return mustFlipVertically;
}
/** Returns the texture data, or null if it is specified as a set of mipmaps. */
public Buffer getBuffer() {
@@ -384,18 +384,18 @@ public class TextureData {
}
/** Returns all mipmap levels for the texture data, or null if it is
specified as a single image. */
- public Buffer[] getMipmapData() {
- return mipmapData;
+ public Buffer[] getMipmapData() {
+ return mipmapData;
}
/** Returns the required byte alignment for the texture data. */
- public int getAlignment() {
- return alignment;
+ public int getAlignment() {
+ return alignment;
}
/** Returns the row length needed for correct GL_UNPACK_ROW_LENGTH
specification. This is currently only supported for
non-mipmapped, non-compressed textures. */
- public int getRowLength() {
- return rowLength;
+ public int getRowLength() {
+ return rowLength;
}
/** Sets the width in pixels of the texture data. */
@@ -405,25 +405,25 @@ public class TextureData {
/** Sets the border in pixels of the texture data. */
public void setBorder(int border) { this.border = border; }
/** Sets the intended OpenGL pixel format of the texture data. */
- public void setPixelAttributes(GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
- /**
+ public void setPixelAttributes(GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
+ /**
* Sets the intended OpenGL pixel format component of {@link GLPixelAttributes} of the texture data.
*
- * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
- *
+ * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
+ *
*/
public void setPixelFormat(int pixelFormat) {
if( pixelAttributes.format != pixelFormat ) {
pixelAttributes = new GLPixelAttributes(pixelFormat, pixelAttributes.type);
}
}
- /**
+ /**
* Sets the intended OpenGL pixel type component of {@link GLPixelAttributes} of the texture data.
*
- * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
- *
+ * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
+ *
*/
- public void setPixelType(int pixelType) {
+ public void setPixelType(int pixelType) {
if( pixelAttributes.type != pixelType) {
pixelAttributes = new GLPixelAttributes(pixelAttributes.format, pixelType);
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
index 3748cd336..b6d89d6d2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 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.
*/
@@ -161,11 +161,11 @@ public class TextureIO {
/** Constant which can be used as a file suffix to indicate a PAM
file, NetPbm magic 7 - binary RGB and RGBA. Write support only. */
public static final String PAM = "pam";
-
+
/** Constant which can be used as a file suffix to indicate a PAM
file, NetPbm magic 6 - binary RGB. Write support only. */
public static final String PPM = "ppm";
-
+
private static final boolean DEBUG = Debug.debug("TextureIO");
// For manually disabling the use of the texture rectangle
@@ -421,7 +421,7 @@ public class TextureIO {
// methods that *do* require a current context
//
- /**
+ /**
* Creates an OpenGL texture object from the specified TextureData
* using the current OpenGL context.
*
@@ -434,7 +434,7 @@ public class TextureIO {
return newTexture(GLContext.getCurrentGL(), data);
}
- /**
+ /**
* Creates an OpenGL texture object from the specified TextureData
* using the given OpenGL context.
*
@@ -449,8 +449,8 @@ public class TextureIO {
}
return new Texture(gl, data);
}
-
- /**
+
+ /**
* Creates an OpenGL texture object from the specified file using
* the current OpenGL context.
*
@@ -474,7 +474,7 @@ public class TextureIO {
return texture;
}
- /**
+ /**
* Creates an OpenGL texture object from the specified stream using
* the current OpenGL context.
*
@@ -503,7 +503,7 @@ public class TextureIO {
return texture;
}
- /**
+ /**
* Creates an OpenGL texture object from the specified URL using the
* current OpenGL context.
*
@@ -535,13 +535,13 @@ public class TextureIO {
return texture;
}
- /**
+ /**
* Creates an OpenGL texture object associated with the given OpenGL
* texture target. The texture has
* no initial data. This is used, for example, to construct cube
* maps out of multiple TextureData objects.
*
- * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
+ * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
* GL.GL_TEXTURE_RECTANGLE_ARB
*/
public static Texture newTexture(int target) {
@@ -556,7 +556,7 @@ public class TextureIO {
* undefined results.
*
* @param textureID the OpenGL texture object to wrap
- * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
+ * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
* GL2.GL_TEXTURE_RECTANGLE
* @param texWidth the width of the texture in pixels
* @param texHeight the height of the texture in pixels
@@ -689,7 +689,7 @@ public class TextureIO {
gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
-
+
data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
false, false, false, res, null);
@@ -701,7 +701,7 @@ public class TextureIO {
write(data, file);
}
-
+
public static void write(TextureData data, File file) throws IOException, GLException {
for (Iterator iter = textureWriters.iterator(); iter.hasNext(); ) {
TextureWriter writer = iter.next();
@@ -712,12 +712,12 @@ public class TextureIO {
throw new IOException("No suitable texture writer found for "+file.getAbsolutePath());
}
-
+
//----------------------------------------------------------------------
// SPI support
//
- /**
+ /**
* Adds a TextureProvider to support reading of a new file format.
*
* The last provider added, will be the first provider to be tested.
@@ -730,7 +730,7 @@ public class TextureIO {
textureProviders.add(0, provider);
}
- /**
+ /**
* Adds a TextureWriter to support writing of a new file format.
*
* The last provider added, will be the first provider to be tested.
@@ -779,7 +779,7 @@ public class TextureIO {
private static List textureProviders = new ArrayList();
private static List textureWriters = new ArrayList();
- static {
+ static {
// ImageIO provider, the fall-back, must be the first one added
if(GLProfile.isAWTAvailable()) {
try {
@@ -1221,7 +1221,7 @@ public class TextureIO {
return null;
}
}
-
+
//----------------------------------------------------------------------
// DDS texture writer
//
@@ -1249,7 +1249,7 @@ public class TextureIO {
case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: d3dFormat = DDSImage.D3DFMT_DXT5; break;
default: throw new IOException("Unsupported pixel format 0x" + Integer.toHexString(pixelFormat) + " by DDS writer");
}
-
+
ByteBuffer[] mipmaps = null;
if (data.getMipmapData() != null) {
mipmaps = new ByteBuffer[data.getMipmapData().length];
@@ -1319,7 +1319,7 @@ public class TextureIO {
//----------------------------------------------------------------------
// TGA (Targa) texture writer
-
+
static class TGATextureWriter implements TextureWriter {
public boolean write(File file,
TextureData data) throws IOException {
@@ -1329,19 +1329,19 @@ public class TextureIO {
final int pixelFormat = pixelAttribs.format;
final int pixelType = pixelAttribs.type;
if ((pixelFormat == GL.GL_RGB ||
- pixelFormat == GL.GL_RGBA ||
+ pixelFormat == GL.GL_RGBA ||
pixelFormat == GL2.GL_BGR ||
pixelFormat == GL.GL_BGRA ) &&
(pixelType == GL.GL_BYTE ||
pixelType == GL.GL_UNSIGNED_BYTE)) {
-
+
ByteBuffer buf = (ByteBuffer) data.getBuffer();
if (null == buf) {
buf = (ByteBuffer) data.getMipmapData()[0];
}
buf.rewind();
-
- if( pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA ) {
+
+ if( pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA ) {
// Must reverse order of red and blue channels to get correct results
int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
for (int i = 0; i < buf.remaining(); i += skip) {
@@ -1364,12 +1364,12 @@ public class TextureIO {
}
return false;
- }
+ }
}
//----------------------------------------------------------------------
// PNG texture writer
-
+
static class PNGTextureWriter implements TextureWriter {
public boolean write(File file, TextureData data) throws IOException {
if (PNG.equals(IOUtil.getFileSuffix(file))) {
@@ -1402,13 +1402,13 @@ public class TextureIO {
break;
}
if ( ( 1 == bytesPerPixel || 3 == bytesPerPixel || 4 == bytesPerPixel) &&
- ( pixelType == GL.GL_BYTE || pixelType == GL.GL_UNSIGNED_BYTE)) {
+ ( pixelType == GL.GL_BYTE || pixelType == GL.GL_UNSIGNED_BYTE)) {
ByteBuffer buf = (ByteBuffer) data.getBuffer();
if (null == buf) {
buf = (ByteBuffer) data.getMipmapData()[0];
}
buf.rewind();
-
+
PNGImage image = PNGImage.createFromData(data.getWidth(), data.getHeight(), -1f, -1f,
bytesPerPixel, reversedChannels, !data.getMustFlipVertically(), buf);
image.write(file, true);
@@ -1418,9 +1418,9 @@ public class TextureIO {
" / type 0x"+Integer.toHexString(pixelFormat)+" (only GL_RGB/A, GL_BGR/A + bytes)");
}
return false;
- }
+ }
}
-
+
//----------------------------------------------------------------------
// Helper routines
//
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index 5c6b63535..e4f72abf0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.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.
@@ -36,26 +36,26 @@ import com.jogamp.opengl.util.TimeFrameI;
/**
* Protocol for texture sequences, like animations, movies, etc.
*
- * Ensure to respect the texture coordinates provided by
+ * Ensure to respect the texture coordinates provided by
* {@link TextureFrame}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getImageTexCoords() getImageTexCoords()}.
*
- * The user's shader shall be fitted for this implementation.
+ * The user's shader shall be fitted for this implementation.
* Assuming we use a base shader code w/o headers using ShaderCode.
* (Code copied from unit test / demo TexCubeES2)
*
- *
+ *
static final String[] es2_prelude = { "#version 100\n", "precision mediump float;\n" };
static final String gl2_prelude = "#version 110\n";
static final String shaderBasename = "texsequence_xxx"; // the base shader code w/o headers
- static final String myTextureLookupName = "myTexture2D"; // the desired texture lookup function
-
+ static final String myTextureLookupName = "myTexture2D"; // the desired texture lookup function
+
private void initShader(GL2ES2 gl, TextureSequence texSeq) {
// Create & Compile the shader objects
- ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, TexCubeES2.class,
+ ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, TexCubeES2.class,
"shader", "shader/bin", shaderBasename, true);
- ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, TexCubeES2.class,
+ ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, TexCubeES2.class,
"shader", "shader/bin", shaderBasename, true);
-
+
// Prelude shader code w/ GLSL profile specifics [ 1. pre-proc, 2. other ]
int rsFpPos;
if(gl.isGLES2()) {
@@ -72,25 +72,25 @@ import com.jogamp.opengl.util.TimeFrameI;
if(gl.isGLES2()) {
// insert ES2 default precision declaration
rsFpPos = rsFp.insertShaderSource(0, rsFpPos, es2_prelude[1]);
- }
+ }
// negotiate the texture lookup function name
final String texLookupFuncName = texSeq.getTextureLookupFunctionName(myTextureLookupName);
-
- // in case a fixed lookup function is being chosen, replace the name in our code
+
+ // in case a fixed lookup function is being chosen, replace the name in our code
rsFp.replaceInShaderSource(myTextureLookupName, texLookupFuncName);
-
+
// Cache the TextureSequence shader details in StringBuilder:
final StringBuilder sFpIns = new StringBuilder();
-
+
// .. declaration of the texture sampler using the implementation specific type
sFpIns.append("uniform ").append(texSeq.getTextureSampler2DType()).append(" mgl_ActiveTexture;\n");
-
+
// .. the actual texture lookup function, maybe null in case a built-in function is being used
sFpIns.append(texSeq.getTextureLookupFragmentShaderImpl());
-
+
// Now insert the TextureShader details in our shader after the given tag:
rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
-
+
// Create & Link the shader program
ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
@@ -102,16 +102,16 @@ import com.jogamp.opengl.util.TimeFrameI;
*
* The above procedure might look complicated, however, it allows most flexibility and
* workarounds to also deal with GLSL bugs.
- *
+ *
*/
public interface TextureSequence {
public static final String GL_OES_EGL_image_external_Required_Prelude = "#extension GL_OES_EGL_image_external : enable\n";
public static final String samplerExternalOES = "samplerExternalOES";
public static final String sampler2D = "sampler2D";
-
- /**
+
+ /**
* Texture holder interface, maybe specialized by implementation
- * to associated related data.
+ * to associated related data.
*/
public static class TextureFrame extends TimeFrameI {
public TextureFrame(Texture t, int pts, int duration) {
@@ -121,9 +121,9 @@ public interface TextureSequence {
public TextureFrame(Texture t) {
texture = t;
}
-
+
public final Texture getTexture() { return texture; }
-
+
public String toString() {
return "TextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ (null != texture ? texture.getTextureObject() : 0) + "]";
}
@@ -139,30 +139,30 @@ public interface TextureSequence {
*
* Further more, the call may happen off-thread, possibly holding another, possibly shared, OpenGL context current.
*
- * Hence a user shall not issue any OpenGL, time consuming
+ * Hence a user shall not issue any OpenGL, time consuming
* or {@link TextureSequence} lifecycle operations directly.
* Instead, the user shall:
*
*
issue commands off-thread via spawning off another thread, or
*
injecting {@link GLRunnable} objects via {@link GLAutoDrawable#invoke(boolean, GLRunnable)}, or
*
simply changing a volatile state of their {@link GLEventListener} implementation.
- *
+ *
*
* */
public interface TexSeqEventListener {
- /**
+ /**
* Signaling listeners that a new {@link TextureFrame} is available.
*
- * User shall utilize {@link TextureSequence#getNextTexture(GL)} to dequeue it to maintain
- * a consistent queue.
+ * User shall utilize {@link TextureSequence#getNextTexture(GL)} to dequeue it to maintain
+ * a consistent queue.
*
- * @param ts the event source
+ * @param ts the event source
* @param newFrame the newly enqueued frame
- * @param when system time in msec.
+ * @param when system time in msec.
**/
public void newFrameAvailable(T ts, TextureFrame newFrame, long when);
}
-
+
/** Return the texture unit used to render the current frame. */
public int getTextureUnit();
@@ -174,17 +174,17 @@ public interface TextureSequence {
* Returns the last updated texture.
*
* In case the instance is just initialized, it shall return a TextureFrame
- * object with valid attributes. The texture content may be undefined
+ * object with valid attributes. The texture content may be undefined
* until the first call of {@link #getNextTexture(GL)}.
- *
+ *
* Not blocking.
- *
- * @throws IllegalStateException if instance is not initialized
+ *
+ * @throws IllegalStateException if instance is not initialized
*/
public TextureFrame getLastTexture() throws IllegalStateException ;
/**
- * Returns the next texture to be rendered.
+ * Returns the next texture to be rendered.
*
* Implementation shall return the next frame if available, may block if a next frame may arrive soon.
* Otherwise implementation shall return the last frame.
@@ -192,41 +192,41 @@ public interface TextureSequence {
*
* Shall return null in case no next or last frame is available.
*
- *
- * @throws IllegalStateException if instance is not initialized
+ *
+ * @throws IllegalStateException if instance is not initialized
*/
public TextureFrame getNextTexture(GL gl) throws IllegalStateException ;
-
+
/**
- * In case a shader extension is required, based on the implementation
+ * In case a shader extension is required, based on the implementation
* and the runtime GL profile, this method returns the preprocessor macros, e.g.:
*
- *
- * @throws IllegalStateException if instance is not initialized
+ *
+ *
+ * @throws IllegalStateException if instance is not initialized
*/
public String getRequiredExtensionsShaderStub() throws IllegalStateException ;
-
- /**
+
+ /**
* Returns either sampler2D or samplerExternalOES
- * depending on {@link #getLastTexture()}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getTarget() getTarget()}.
- *
- * @throws IllegalStateException if instance is not initialized
+ * depending on {@link #getLastTexture()}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getTarget() getTarget()}.
+ *
+ * @throws IllegalStateException if instance is not initialized
**/
public String getTextureSampler2DType() throws IllegalStateException ;
-
+
/**
* @param desiredFuncName desired lookup function name. If null or ignored by the implementation,
- * a build-in name is returned.
+ * a build-in name is returned.
* @return the final lookup function name
- *
+ *
* @see {@link #getTextureLookupFragmentShaderImpl()}
- *
+ *
* @throws IllegalStateException if instance is not initialized
*/
public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException ;
-
+
/**
* Returns the complete texture2D lookup function code of type
*
@@ -239,14 +239,14 @@ public interface TextureSequence {
* funcName can be negotiated and queried via {@link #getTextureLookupFunctionName(String)}.
*
* Note: This function may return an empty string in case a build-in lookup
- * function is being chosen. If the implementation desires so,
+ * function is being chosen. If the implementation desires so,
* {@link #getTextureLookupFunctionName(String)} will ignore the desired function name
* and returns the build-in lookup function name.
*
* @see #getTextureLookupFunctionName(String)
* @see #getTextureSampler2DType()
- *
- * @throws IllegalStateException if instance is not initialized
+ *
+ * @throws IllegalStateException if instance is not initialized
*/
- public String getTextureLookupFragmentShaderImpl() throws IllegalStateException ;
+ public String getTextureLookupFragmentShaderImpl() throws IllegalStateException ;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
index 4a5d368e3..c8437d07c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
@@ -43,55 +43,55 @@ import javax.media.opengl.GLException;
* - GL.GL_TEXTURE_MAG_FILTER
* - GL.GL_TEXTURE_MIN_FILTER
* - GL.GL_TEXTURE_WRAP_S
- * - GL.GL_TEXTURE_WRAP_T
+ * - GL.GL_TEXTURE_WRAP_T
*
*/
public class TextureState {
- /**
+ /**
* Returns the pname to query the textureTarget currently bound to the active texture-unit.
*
* Returns 0 is textureTarget is not supported.
- *
- */
+ *
+ */
public static final int getTextureTargetQueryName(int textureTarget) {
final int texBindQName;
switch(textureTarget) {
- case GL.GL_TEXTURE_2D: texBindQName = GL.GL_TEXTURE_BINDING_2D; break;
- case GL.GL_TEXTURE_CUBE_MAP: texBindQName = GL.GL_TEXTURE_BINDING_CUBE_MAP; break;
- case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break;
- case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break;
- case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break;
- case GL2GL3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_2D_ARRAY; break;
- case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break;
- case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break;
- case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
+ case GL.GL_TEXTURE_2D: texBindQName = GL.GL_TEXTURE_BINDING_2D; break;
+ case GL.GL_TEXTURE_CUBE_MAP: texBindQName = GL.GL_TEXTURE_BINDING_CUBE_MAP; break;
+ case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break;
+ case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break;
+ case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break;
+ case GL2GL3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_2D_ARRAY; break;
+ case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break;
+ case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break;
+ case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
case GL3.GL_TEXTURE_2D_MULTISAMPLE_ARRAY: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY; break;
default: texBindQName = 0;
}
return texBindQName;
}
-
+
private final int target;
- /**
+ /**
*
*/
private final int[] state = new int[] { 0, 0, 0, 0, 0, 0 };
-
+
private static final String toHexString(int i) { return "0x"+Integer.toHexString(i); }
-
+
private static final int activeTexture(GL gl) {
final int[] vi = { 0 };
gl.glGetIntegerv(GL.GL_ACTIVE_TEXTURE, vi, 0);
return vi[0];
}
-
+
/**
* Creates a texture state for the retrieved active texture-unit and the given texture-target.
* See {@link TextureState}.
@@ -102,7 +102,7 @@ public class TextureState {
public TextureState(GL gl, int textureTarget) throws GLException {
this(gl, activeTexture(gl), textureTarget);
}
-
+
/**
* Creates a texture state for the given active texture-unit and the given texture-target.
* See {@link TextureState}.
@@ -124,7 +124,7 @@ public class TextureState {
gl.glGetTexParameteriv(target, GL.GL_TEXTURE_WRAP_S, state, 4);
gl.glGetTexParameteriv(target, GL.GL_TEXTURE_WRAP_T, state, 5);
}
-
+
/**
* Restores the texture-unit's texture-target state.
*
@@ -140,12 +140,12 @@ public class TextureState {
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S, state[4]);
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T, state[5]);
}
-
+
/** Returns the texture-unit of this state, key value. Unit is of range [ {@link GL#GL_TEXTURE0}.. ]. */
public final int getUnit() { return state[0]; }
/** Returns the texture-target of this state, key value. */
public final int getTarget() { return target; }
-
+
/** Returns the state's texture-object. */
public final int getObject() { return state[1]; }
/** Returns the state's mag-filter param. */
@@ -156,12 +156,12 @@ public class TextureState {
public final int getWrapS() { return state[4]; }
/** Returns the state's wrap-t param. */
public final int getWrapT() { return state[5]; }
-
-
+
+
public final String toString() {
return "TextureState[unit "+(state[0] - GL.GL_TEXTURE0)+", target "+toHexString(target)+
": obj "+toHexString(state[1])+
- ", filter[mag "+toHexString(state[2])+", min "+toHexString(state[3])+"], "+
+ ", filter[mag "+toHexString(state[2])+", min "+toHexString(state[3])+"], "+
": wrap[s "+toHexString(state[4])+", t "+toHexString(state[5])+"]]";
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
index d7e825c1d..202c08e4e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 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.
@@ -80,7 +80,7 @@ public class AWTTextureData extends TextureData {
private static final java.awt.image.ColorModel rgbaColorModel =
new ComponentColorModel(java.awt.color.ColorSpace.getInstance(java.awt.color.ColorSpace.CS_sRGB),
- new int[] {8, 8, 8, 8}, true, true,
+ new int[] {8, 8, 8, 8}, true, true,
Transparency.TRANSLUCENT,
DataBuffer.TYPE_BYTE);
private static final java.awt.image.ColorModel rgbColorModel =
@@ -90,7 +90,7 @@ public class AWTTextureData extends TextureData {
DataBuffer.TYPE_BYTE);
- /**
+ /**
* Constructs a new TextureData object with the specified parameters
* and data contained in the given BufferedImage. The resulting
* TextureData "wraps" the contents of the BufferedImage, so if a
@@ -113,7 +113,7 @@ public class AWTTextureData extends TextureData {
* texture
* @param image the image containing the texture data
*/
- public AWTTextureData(GLProfile glp,
+ public AWTTextureData(GLProfile glp,
int internalFormat,
int pixelFormat,
boolean mipmap,
@@ -142,15 +142,15 @@ public class AWTTextureData extends TextureData {
(expectingGL12 && haveGL12))) {
revertPixelAttributes();
}
- }
+ }
}
-
+
@Override
public GLPixelAttributes getPixelAttributes() {
validatePixelAttributes();
return super.getPixelAttributes();
}
-
+
@Override
public int getPixelFormat() {
validatePixelAttributes();
@@ -246,7 +246,7 @@ public class AWTTextureData extends TextureData {
// we can pass the image data directly to OpenGL only if
// we have an integral number of pixels in each scanline
// and only if the GL_EXT_abgr extension is present
-
+
// NOTE: disabling this code path for now as it appears it's
// buggy at least on some NVidia drivers and doesn't perform
// the necessary byte swapping (FIXME: needs more
@@ -255,7 +255,7 @@ public class AWTTextureData extends TextureData {
pixelAttributes = new GLPixelAttributes(GL2.GL_ABGR_EXT, GL.GL_UNSIGNED_BYTE);
rowLength = scanlineStride / 4;
alignment = 4;
-
+
// Store a reference to the original image for later in
// case it turns out that we don't have GL_EXT_abgr at the
// time we're going to do the texture upload to OpenGL
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
index fdd1365f7..c70f5d0f3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
@@ -100,7 +100,7 @@ public class AWTTextureIO extends TextureIO {
return newTextureDataImpl(glp, image, internalFormat, pixelFormat, mipmap);
}
- /**
+ /**
* Creates an OpenGL texture object from the specified BufferedImage
* using the current OpenGL context.
*
@@ -119,7 +119,7 @@ public class AWTTextureIO extends TextureIO {
return texture;
}
- private static TextureData newTextureDataImpl(GLProfile glp,
+ private static TextureData newTextureDataImpl(GLProfile glp,
BufferedImage image,
int internalFormat,
int pixelFormat,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
index 3f91ae966..d75bb3767 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
@@ -166,7 +166,7 @@ public class DDSImage {
public static DDSImage read(String filename) throws IOException {
return read(new File(filename));
}
-
+
/** Reads a DirectDraw surface from the specified file, returning
the resulting DDSImage.
@@ -212,7 +212,7 @@ public class DDSImage {
}
}
- /**
+ /**
* Creates a new DDSImage from data supplied by the user. The
* resulting DDSImage can be written to disk using the write()
* method.
@@ -763,7 +763,7 @@ public class DDSImage {
default:
throw new IllegalArgumentException("d3dFormat must be one of the known formats");
}
-
+
// Now check the mipmaps against this size
int curSize = topmostMipmapSize;
int totalSize = 0;
@@ -785,7 +785,7 @@ public class DDSImage {
buf.put(mipmapData[i]);
}
this.buf = buf;
-
+
// Allocate and initialize a Header
header = new Header();
header.size = Header.size();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
index 4d3d088ba..471938754 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.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.
@@ -40,12 +40,12 @@ import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.util.texture.TextureData.ColorSpace;
public class JPEGImage {
- private static final boolean DEBUG = Debug.debug("JPEGImage");
-
-
+ private static final boolean DEBUG = Debug.debug("JPEGImage");
+
+
/**
* Reads a JPEG image from the specified InputStream, using the given color space for storage.
- *
+ *
* @param in
* @param cs Storage color space, either {@link ColorSpace#RGB} or {@link ColorSpace#YCbCr}. {@link ColorSpace#YCCK} and {@link ColorSpace#CMYK} will throw an exception!
* @return
@@ -54,12 +54,12 @@ public class JPEGImage {
public static JPEGImage read(InputStream in, ColorSpace cs) throws IOException {
return new JPEGImage(in, cs);
}
-
+
/** Reads a JPEG image from the specified InputStream, using the {@link ColorSpace#RGB}. */
public static JPEGImage read(InputStream in) throws IOException {
return new JPEGImage(in, ColorSpace.RGB);
}
-
+
private static class JPEGColorSink implements JPEGDecoder.ColorSink {
int width=0, height=0;
int sourceComponents=0;
@@ -67,7 +67,7 @@ public class JPEGImage {
int storageComponents;
final ColorSpace storageCS;
ByteBuffer data = null;
-
+
JPEGColorSink(ColorSpace storageCM) {
this.storageCS = storageCM;
switch(storageCS) {
@@ -79,7 +79,7 @@ public class JPEGImage {
throw new IllegalArgumentException("Unsupported storage color-space: "+storageCS);
}
}
-
+
@Override
public final ColorSpace allocate(int width, int height, ColorSpace sourceCM, int sourceComponents) throws RuntimeException {
this.width = width;
@@ -96,7 +96,7 @@ public class JPEGImage {
data.put(i++, r);
data.put(i++, g);
data.put(i++, b);
- // data.put(i++, (byte)0xff);
+ // data.put(i++, (byte)0xff);
}
@Override
@@ -111,12 +111,12 @@ public class JPEGImage {
data.put(i++, Cb);
data.put(i++, Cr);
}
-
+
public String toString() {
return "JPEGPixels["+width+"x"+height+", sourceComp "+sourceComponents+", sourceCS "+sourceCS+", storageCS "+storageCS+", storageComp "+storageComponents+"]";
}
};
-
+
private JPEGImage(InputStream in, ColorSpace cs) throws IOException {
pixelStorage = new JPEGColorSink(cs);
final JPEGDecoder decoder = new JPEGDecoder();
@@ -126,7 +126,7 @@ public class JPEGImage {
decoder.getPixel(pixelStorage, pixelWidth, pixelHeight);
data = pixelStorage.data;
final boolean hasAlpha = false;
-
+
bytesPerPixel = 3;
glFormat = GL.GL_RGB;
reversedChannels = false; // RGB[A]
@@ -142,7 +142,7 @@ public class JPEGImage {
private final int pixelWidth, pixelHeight, glFormat, bytesPerPixel;
private boolean reversedChannels;
private final ByteBuffer data;
-
+
/** Returns the color space of the pixel data */
public ColorSpace getColorSpace() { return pixelStorage.storageCS; }
@@ -157,10 +157,10 @@ public class JPEGImage {
/** Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected. */
public boolean getHasReversedChannels() { return reversedChannels; }
-
+
/** Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA. */
public int getGLFormat() { return glFormat; }
-
+
/** Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE. */
public int getGLType() { return GL.GL_UNSIGNED_BYTE; }
@@ -170,6 +170,6 @@ public class JPEGImage {
/** Returns the raw data for this texture in the correct
(bottom-to-top) order for calls to glTexImage2D. */
public ByteBuffer getData() { return data; }
-
+
public String toString() { return "JPEGImage["+pixelWidth+"x"+pixelHeight+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+pixelStorage+", "+data+"]"; }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
index b7262aa3e..4020ab3c0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -148,7 +148,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
}
public final int readUnsignedShort() throws IOException
- {
+ {
int ch1 = dataIn.read();
int ch2 = dataIn.read();
if ((ch1 | ch2) < 0)
@@ -195,7 +195,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
/**
* dont call this it is not implemented.
- * @return empty new string
+ * @return empty new string
**/
public final String readLine() throws IOException
{
@@ -204,7 +204,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
/**
* dont call this it is not implemented
- * @return empty new string
+ * @return empty new string
**/
public final String readUTF() throws IOException
{
@@ -213,7 +213,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
/**
* dont call this it is not implemented
- * @return empty new string
+ * @return empty new string
**/
public final static String readUTF(DataInput in) throws IOException
{
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
index e1e1ca924..a7101a576 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
index cd42a1157..43b8eebe6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
@@ -87,8 +87,8 @@ public class NetPbmTextureWriter implements TextureWriter {
public boolean write(File file, TextureData data) throws IOException {
boolean res;
final int magic_old = magic;
-
- // file suffix selection
+
+ // file suffix selection
if (0==magic) {
if (PPM.equals(IOUtil.getFileSuffix(file))) {
magic = 6;
@@ -97,7 +97,7 @@ public class NetPbmTextureWriter implements TextureWriter {
} else {
return false;
}
- }
+ }
try {
res = writeImpl(file, data);
} finally {
@@ -105,7 +105,7 @@ public class NetPbmTextureWriter implements TextureWriter {
}
return res;
}
-
+
private boolean writeImpl(File file, TextureData data) throws IOException {
int pixelFormat = data.getPixelFormat();
final int pixelType = data.getPixelType();
@@ -115,16 +115,16 @@ public class NetPbmTextureWriter implements TextureWriter {
pixelFormat == GL.GL_BGRA ) &&
(pixelType == GL.GL_BYTE ||
pixelType == GL.GL_UNSIGNED_BYTE)) {
-
+
ByteBuffer buf = (ByteBuffer) data.getBuffer();
if (null == buf ) {
buf = (ByteBuffer) data.getMipmapData()[0];
}
buf.rewind();
-
+
int comps = ( pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA ) ? 4 : 3 ;
-
- if( pixelFormat == GL2.GL_BGR || pixelFormat == GL.GL_BGRA ) {
+
+ if( pixelFormat == GL2.GL_BGR || pixelFormat == GL.GL_BGRA ) {
// Must reverse order of red and blue channels to get correct results
for (int i = 0; i < buf.remaining(); i += comps) {
byte red = buf.get(i + 0);
@@ -141,7 +141,7 @@ public class NetPbmTextureWriter implements TextureWriter {
}
FileOutputStream fos = IOUtil.getFileOutputStream(file, true);
-
+
StringBuilder header = new StringBuilder();
header.append("P");
header.append(magic);
@@ -171,7 +171,7 @@ public class NetPbmTextureWriter implements TextureWriter {
}
fos.write(header.toString().getBytes());
-
+
FileChannel fosc = fos.getChannel();
fosc.write(buf);
fosc.force(true);
@@ -180,7 +180,7 @@ public class NetPbmTextureWriter implements TextureWriter {
buf.rewind();
return true;
- }
+ }
throw new IOException("NetPbmTextureWriter writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
index 0f4559036..bfde1bfac 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.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.
@@ -51,15 +51,15 @@ import com.jogamp.common.nio.Buffers;
import com.jogamp.common.util.IOUtil;
public class PNGImage {
- private static final boolean DEBUG = Debug.debug("PNGImage");
-
+ private static final boolean DEBUG = Debug.debug("PNGImage");
+
/**
* Creates a PNGImage from data supplied by the end user. Shares
* data with the passed ByteBuffer. Assumes the data is already in
* the correct byte order for writing to disk, i.e., LUMINANCE, RGB or RGBA.
* Orientation is bottom-to-top (OpenGL coord. default)
* or top-to-bottom depending on isGLOriented.
- *
+ *
* @param width
* @param height
* @param dpiX
@@ -74,17 +74,17 @@ public class PNGImage {
int bytesPerPixel, boolean reversedChannels, boolean isGLOriented, ByteBuffer data) {
return new PNGImage(width, height, dpiX, dpiY, bytesPerPixel, reversedChannels, isGLOriented, data);
}
-
- /**
+
+ /**
* Reads a PNG image from the specified InputStream.
*
* Implicitly flip image to GL orientation, see {@link #isGLOriented()}.
- *
+ *
*/
public static PNGImage read(InputStream in) throws IOException {
return new PNGImage(in);
}
-
+
/** Reverse read and store, implicitly flip image to GL orientation, see {@link #isGLOriented()}. */
private static final int getPixelRGBA8(ByteBuffer d, int dOff, int[] scanline, int lineOff, boolean hasAlpha) {
final int b = hasAlpha ? 4-1 : 3-1;
@@ -95,11 +95,11 @@ public class PNGImage {
d.put(dOff--, (byte)scanline[lineOff + 3]); // A
}
d.put(dOff--, (byte)scanline[lineOff + 2]); // B
- d.put(dOff--, (byte)scanline[lineOff + 1]); // G
+ d.put(dOff--, (byte)scanline[lineOff + 1]); // G
d.put(dOff--, (byte)scanline[lineOff ]); // R
return dOff;
}
-
+
/** Reverse write and store, implicitly flip image from current orientation, see {@link #isGLOriented()}. Handle reversed channels (BGR[A]). */
private int setPixelRGBA8(ImageLine line, int lineOff, ByteBuffer d, int dOff, boolean hasAlpha) {
final int b = hasAlpha ? 4-1 : 3-1;
@@ -138,9 +138,9 @@ public class PNGImage {
this.bytesPerPixel = bytesPerPixel;
this.reversedChannels = reversedChannels;
this.isGLOriented = isGLOriented;
- this.data = data;
+ this.data = data;
}
-
+
private PNGImage(InputStream in) {
final PngReader pngr = new PngReader(new BufferedInputStream(in), null);
final ImageInfo imgInfo = pngr.imgInfo;
@@ -148,12 +148,12 @@ public class PNGImage {
final PngChunkTRNS trns = pngr.getMetadata().getTRNS();
final boolean indexed = imgInfo.indexed;
final boolean hasAlpha = indexed ? ( trns != null ) : imgInfo.alpha ;
-
+
final int channels = indexed ? ( hasAlpha ? 4 : 3 ) : imgInfo.channels ;
if ( ! ( 1 == channels || 3 == channels || 4 == channels ) ) {
throw new RuntimeException("PNGImage can only handle Lum/RGB/RGBA [1/3/4 channels] images for now. Channels "+channels + " Paletted: " + indexed);
}
-
+
bytesPerPixel = indexed ? channels : imgInfo.bytesPixel ;
if ( ! ( 1 == bytesPerPixel || 3 == bytesPerPixel || 4 == bytesPerPixel ) ) {
throw new RuntimeException("PNGImage can only handle Lum/RGB/RGBA [1/3/4 bpp] images for now. BytesPerPixel "+bytesPerPixel);
@@ -189,14 +189,14 @@ public class PNGImage {
", bytesPerPixel "+bytesPerPixel+"/"+imgInfo.bytesPixel+
", pixels "+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+"x"+dpi[1]+", glFormat 0x"+Integer.toHexString(glFormat));
}
-
+
data = Buffers.newDirectByteBuffer(bytesPerPixel * pixelWidth * pixelHeight);
reversedChannels = false; // RGB[A]
isGLOriented = true;
int dataOff = bytesPerPixel * pixelWidth * pixelHeight - 1; // start at end-of-buffer, reverse store
int[] rgbaScanline = indexed ? new int[imgInfo.cols * channels] : null;
-
+
for (int row = 0; row < pixelHeight; row++) {
final ImageLine l1 = pngr.readRow(row);
int lineOff = ( pixelWidth - 1 ) * bytesPerPixel ; // start w/ last pixel in line, reverse read (PNG top-left -> OpenGL bottom-left origin)
@@ -224,7 +224,7 @@ public class PNGImage {
private final boolean isGLOriented;
private final double[] dpi;
private final ByteBuffer data;
-
+
/** Returns the width of the image. */
public int getWidth() { return pixelWidth; }
@@ -233,23 +233,23 @@ public class PNGImage {
/** Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected. */
public boolean getHasReversedChannels() { return reversedChannels; }
-
+
/**
- * Returns true if the drawable is rendered in
+ * Returns true if the drawable is rendered in
* OpenGL's coordinate system, origin at bottom left.
* Otherwise returns false, i.e. origin at top left.
*
* Default impl. is true, i.e. OpenGL coordinate system.
- *
+ *
*/
public boolean isGLOriented() { return isGLOriented; }
-
+
/** Returns the dpi of the image. */
public double[] getDpi() { return dpi; }
-
+
/** Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA. */
public int getGLFormat() { return glFormat; }
-
+
/** Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE. */
public int getGLType() { return GL.GL_UNSIGNED_BYTE; }
@@ -260,12 +260,12 @@ public class PNGImage {
(bottom-to-top) order for calls to glTexImage2D. */
public ByteBuffer getData() { return data; }
- public void write(File out, boolean allowOverwrite) throws IOException {
- final ImageInfo imi = new ImageInfo(pixelWidth, pixelHeight, 8, (4 == bytesPerPixel) ? true : false); // 8 bits per channel, no alpha
+ public void write(File out, boolean allowOverwrite) throws IOException {
+ final ImageInfo imi = new ImageInfo(pixelWidth, pixelHeight, 8, (4 == bytesPerPixel) ? true : false); // 8 bits per channel, no alpha
// open image for writing to a output stream
final OutputStream outs = new BufferedOutputStream(IOUtil.getFileOutputStream(out, allowOverwrite));
try {
- final PngWriter png = new PngWriter(outs, imi);
+ final PngWriter png = new PngWriter(outs, imi);
// add some optional metadata (chunks)
png.getMetadata().setDpi(dpi[0], dpi[1]);
png.getMetadata().setTimeNow(0); // 0 seconds fron now = now
@@ -275,7 +275,7 @@ public class PNGImage {
final ImageLine l1 = new ImageLine(imi);
if( isGLOriented ) {
// start at last pixel at end-of-buffer, reverse read (OpenGL bottom-left -> PNG top-left origin)
- int dataOff = ( pixelWidth * bytesPerPixel * ( pixelHeight - 1 ) ) + // full lines - 1 line
+ int dataOff = ( pixelWidth * bytesPerPixel * ( pixelHeight - 1 ) ) + // full lines - 1 line
( ( pixelWidth - 1 ) * bytesPerPixel ); // one line - 1 pixel
for (int row = 0; row < pixelHeight; row++) {
int lineOff = ( pixelWidth - 1 ) * bytesPerPixel ; // start w/ last pixel in line, reverse store (OpenGL bottom-left -> PNG top-left origin)
@@ -306,13 +306,13 @@ public class PNGImage {
}
}
png.writeRow(l1, row);
- }
+ }
}
png.end();
} finally {
IOUtil.close(outs, false);
}
}
-
- public String toString() { return "PNGImage["+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+" x "+dpi[1]+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+data+"]"; }
+
+ public String toString() { return "PNGImage["+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+" x "+dpi[1]+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+data+"]"; }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
index d35330f58..fd96fba80 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
@@ -1,21 +1,21 @@
/*
* Portions Copyright (c) 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.
*/
@@ -72,15 +72,15 @@ public class SGIImage {
byte storage; // Storage format
// 0 for uncompressed
// 1 for RLE compression
- byte bpc; // Number of bytes per pixel channel
+ byte bpc; // Number of bytes per pixel channel
// Legally 1 or 2
short dimension; // Number of dimensions
// Legally 1, 2, or 3
// 1 means a single row, XSIZE long
// 2 means a single 2D image
// 3 means multiple 2D images
- short xsize; // X size in pixels
- short ysize; // Y size in pixels
+ short xsize; // X size in pixels
+ short ysize; // Y size in pixels
short zsize; // Number of channels
// 1 indicates greyscale
// 3 indicates RGB
@@ -233,7 +233,7 @@ public class SGIImage {
//----------------------------------------------------------------------
// Internals only below this point
//
-
+
private void decodeImage(DataInputStream in) throws IOException {
if (header.storage == 1) {
// Read RLE compression data; row starts and sizes
@@ -478,7 +478,7 @@ public class SGIImage {
for (int z = 0; z < zsize; z++) {
for (int y = ystart; y != yend; y += yincr) {
// RLE-compress each row.
-
+
int x = 0;
byte count = 0;
boolean repeat_mode = false;
@@ -486,7 +486,7 @@ public class SGIImage {
int start_ptr = ptr;
int num_ptr = ptr++;
byte repeat_val = 0;
-
+
while (x < xsize) {
// see if we should switch modes
should_switch = false;
@@ -503,7 +503,7 @@ public class SGIImage {
if (DEBUG)
System.err.println("left side was " + ((int) imgref(data, x, y, z, xsize, ysize, zsize)) +
", right side was " + (int)imgref(data, x+i, y, z, xsize, ysize, zsize));
-
+
if (imgref(data, x, y, z, xsize, ysize, zsize) !=
imgref(data, x+i, y, z, xsize, ysize, zsize))
should_switch = false;
@@ -531,7 +531,7 @@ public class SGIImage {
repeat_mode = true;
repeat_val = imgref(data, x, y, z, xsize, ysize, zsize);
}
-
+
if (x > 0) {
// reset the number pointer
num_ptr = ptr++;
@@ -539,7 +539,7 @@ public class SGIImage {
count = 0;
}
}
-
+
// if not in repeat mode, copy element to ptr
if (!repeat_mode) {
rlebuf[ptr++] = imgref(data, x, y, z, xsize, ysize, zsize);
@@ -581,8 +581,8 @@ public class SGIImage {
// Now we have the offset tables computed, as well as the RLE data.
// Output this information to the file.
total_size = ptr;
-
- if (DEBUG)
+
+ if (DEBUG)
System.err.println("total_size was " + total_size);
DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(IOUtil.getFileOutputStream(file, true)));
@@ -604,7 +604,7 @@ public class SGIImage {
byte[] dest = new byte[16384];
int pos = 0;
int numRead = 0;
-
+
boolean done = false;
do {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
index 2ff3b9cf0..df9430a26 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.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.
*/
@@ -146,9 +146,9 @@ public class TGAImage {
tgaType = TYPE_OLD; // dont try and get footer.
// initial header fields
- idLength = in.readUnsignedByte();
+ idLength = in.readUnsignedByte();
colorMapType = in.readUnsignedByte();
- imageType = in.readUnsignedByte();
+ imageType = in.readUnsignedByte();
// color map header fields
firstEntryIndex = in.readUnsignedShort();
@@ -288,14 +288,14 @@ public class TGAImage {
throw new IOException("TGADecoder Compressed Grayscale images not supported");
}
}
-
+
/**
* This assumes that the body is for a 24 bit or 32 bit for a
* RGB or ARGB image respectively.
*/
private void decodeRGBImageU24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
setupImage24_32(glp);
-
+
int i; // row index
int y; // output row index
int rawWidth = header.width() * bpp;
@@ -317,14 +317,14 @@ public class TGAImage {
swapBGR(tmpData, rawWidth, header.height(), bpp);
data = ByteBuffer.wrap(tmpData);
}
-
+
/**
* This assumes that the body is for a 24 bit or 32 bit for a
* RGB or ARGB image respectively.
*/
private void decodeRGBImageRLE24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
setupImage24_32(glp);
-
+
byte[] pixel = new byte[bpp];
int rawWidth = header.width() * bpp;
byte[] tmpData = new byte[rawWidth * header.height()];
@@ -341,17 +341,17 @@ public class TGAImage {
dIn.read(tmpData, i, len * bpp);
i += bpp * len;
}
-
+
if(format == GL.GL_RGB || format == GL.GL_RGBA)
swapBGR(tmpData, rawWidth, header.height(), bpp);
data = ByteBuffer.wrap(tmpData);
}
-
+
private void setupImage24_32(GLProfile glp) {
bpp = header.pixelDepth / 8;
switch (header.pixelDepth) {
- case 24:
- format = glp.isGL2GL3() ? GL2GL3.GL_BGR : GL.GL_RGB;
+ case 24:
+ format = glp.isGL2GL3() ? GL2GL3.GL_BGR : GL.GL_RGB;
break;
case 32:
boolean useBGRA = glp.isGL2GL3();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
index 88018edbe..0299531b1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
index 55527cef5..35b8efa72 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
index 6e2f1b992..f23cb74bf 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
index 89d0d20a1..438ab6cc2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 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.
*/
@@ -113,7 +113,7 @@ public class IIOTextureWriter implements TextureWriter {
return ImageIO.write(image, IOUtil.getFileSuffix(file), file);
}
-
+
throw new IOException("ImageIO writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
}
}
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL2.java b/src/jogl/classes/javax/media/opengl/DebugGL2.java
index 05bcf3d5e..3c064a18f 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL2.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL2.java
@@ -10,7 +10,7 @@ package javax.media.opengl;
* Sample code which installs this pipeline, manual:
*
+ *
* For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
*
*/
diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
index b0f3da8e4..7e243471e 100644
--- a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
+++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* 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.
*/
@@ -91,7 +91,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
Debug.initSingleton();
DEBUG = Debug.isPropertyDefined("jogl.debug.CapabilitiesChooser", true);
}
-
+
private final static int NO_SCORE = -9999999;
private final static int DOUBLE_BUFFER_MISMATCH_PENALTY = 1000;
private final static int OPAQUE_MISMATCH_PENALTY = 750;
@@ -106,7 +106,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
private final static int ACCUM_MISMATCH_PENALTY_SCALE = 1;
private final static int STENCIL_MISMATCH_PENALTY_SCALE = 3;
private final static int MULTISAMPLE_MISMATCH_PENALTY_SCALE = 3;
-
+
@Override
public int chooseCapabilities(final CapabilitiesImmutable desired,
final List extends CapabilitiesImmutable> available,
@@ -143,12 +143,12 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
// Create score array
int[] scores = new int[availnum];
-
+
for (int i = 0; i < scores.length; i++) {
scores[i] = NO_SCORE;
}
final int gldes_samples = gldes.getNumSamples();
-
+
// Compute score for each
for (int i = 0; i < availnum; i++) {
final GLCapabilitiesImmutable cur = (GLCapabilitiesImmutable) available.get(i);
@@ -165,24 +165,24 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
} */
if (gldes.isPBuffer() && !cur.isPBuffer()) {
continue; // requested pBuffer, but n/a
- }
+ }
if (gldes.isBitmap() && !cur.isBitmap()) {
continue; // requested pBuffer, but n/a
- }
+ }
}
if (gldes.getStereo() != cur.getStereo()) {
continue;
}
final int cur_samples = cur.getNumSamples() ;
int score = 0;
-
+
// Compute difference in color depth
// (Note that this decides the direction of all other penalties)
score += (COLOR_MISMATCH_PENALTY_SCALE *
((cur.getRedBits() + cur.getGreenBits() + cur.getBlueBits() + cur.getAlphaBits()) -
(gldes.getRedBits() + gldes.getGreenBits() + gldes.getBlueBits() + gldes.getAlphaBits())));
// Compute difference in depth buffer depth
- score += (DEPTH_MISMATCH_PENALTY_SCALE * sign(score) *
+ score += (DEPTH_MISMATCH_PENALTY_SCALE * sign(score) *
Math.abs(cur.getDepthBits() - gldes.getDepthBits()));
// Compute difference in accumulation buffer depth
score += (ACCUM_MISMATCH_PENALTY_SCALE * sign(score) *
@@ -261,7 +261,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
System.err.println(" ]");
}
- // Ready to select. Choose score closest to 0.
+ // Ready to select. Choose score closest to 0.
int scoreClosestToZero = NO_SCORE;
int chosenIndex = -1;
for (int i = 0; i < availnum; i++) {
diff --git a/src/jogl/classes/javax/media/opengl/FPSCounter.java b/src/jogl/classes/javax/media/opengl/FPSCounter.java
index 9c07b58e4..4997258e0 100644
--- a/src/jogl/classes/javax/media/opengl/FPSCounter.java
+++ b/src/jogl/classes/javax/media/opengl/FPSCounter.java
@@ -36,28 +36,28 @@ import java.io.PrintStream;
*/
public interface FPSCounter {
public static final int DEFAULT_FRAMES_PER_INTERVAL = 5*60;
-
+
/**
- * @param frames Update interval in frames. At every rendered frames interval the currentTime and fps values are updated.
+ * @param frames Update interval in frames. At every rendered frames interval the currentTime and fps values are updated.
* If the frames interval is <= 0, no update will be issued, ie the FPSCounter feature is turned off. You may choose {@link #DEFAULT_FRAMES_PER_INTERVAL}.
- * @param out optional print stream where the fps values gets printed if not null at every frames interval
+ * @param out optional print stream where the fps values gets printed if not null at every frames interval
*/
void setUpdateFPSFrames(int frames, PrintStream out);
-
+
/**
* Reset all performance counter (startTime, currentTime, frame number)
*/
void resetFPSCounter();
-
+
/**
* @return update interval in frames
- *
+ *
* @see #setUpdateFPSFrames(int, PrintStream)
*/
int getUpdateFPSFrames();
-
+
/**
- * Returns the time of the first display call in milliseconds after enabling this feature via {@link #setUpdateFPSFrames(int, PrintStream)}.
+ * Returns the time of the first display call in milliseconds after enabling this feature via {@link #setUpdateFPSFrames(int, PrintStream)}.
* This value is reset via {@link #resetFPSCounter()}.
*
* @see #setUpdateFPSFrames(int, PrintStream)
@@ -81,18 +81,18 @@ public interface FPSCounter {
* @see #resetFPSCounter()
*/
long getLastFPSPeriod();
-
+
/**
* @return Last update interval's frames per seconds, {@link #getUpdateFPSFrames()} / {@link #getLastFPSPeriod()}
- *
+ *
* @see #setUpdateFPSFrames(int, PrintStream)
* @see #resetFPSCounter()
*/
- float getLastFPS();
-
+ float getLastFPS();
+
/**
* @return Number of frame rendered since {@link #getFPSStartTime()} up to {@link #getLastFPSUpdateTime()}
- *
+ *
* @see #setUpdateFPSFrames(int, PrintStream)
* @see #resetFPSCounter()
*/
@@ -108,10 +108,10 @@ public interface FPSCounter {
/**
- * @return Total frames per seconds, {@link #getTotalFPSFrames()} / {@link #getTotalFPSDuration()}
- *
+ * @return Total frames per seconds, {@link #getTotalFPSFrames()} / {@link #getTotalFPSDuration()}
+ *
* @see #setUpdateFPSFrames(int, PrintStream)
* @see #resetFPSCounter()
*/
- float getTotalFPS();
+ float getTotalFPS();
}
diff --git a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
index a72403eae..827145654 100644
--- a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
+++ b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
@@ -29,7 +29,7 @@
package javax.media.opengl;
/**
- * An animator control interface,
+ * An animator control interface,
* which implementation may drive a {@link javax.media.opengl.GLAutoDrawable} animation.
*/
public interface GLAnimatorControl extends FPSCounter {
@@ -56,8 +56,8 @@ public interface GLAnimatorControl extends FPSCounter {
boolean isAnimating();
/**
- * Indicates whether this animator {@link #isStarted() is started}
- * and either {@link #pause() manually paused} or paused
+ * Indicates whether this animator {@link #isStarted() is started}
+ * and either {@link #pause() manually paused} or paused
* automatically due to no {@link #add(GLAutoDrawable) added} {@link GLAutoDrawable}s.
*
* @see #start()
@@ -157,15 +157,15 @@ public interface GLAnimatorControl extends FPSCounter {
/**
* Adds a drawable to this animator's list of rendering drawables.
*
- * This allows the animator thread to become {@link #isAnimating() animating},
+ * This allows the animator thread to become {@link #isAnimating() animating},
* in case the first drawable is added and the animator {@link #isStarted() is started}.
*
- *
+ *
* @param drawable the drawable to be added
* @throws IllegalArgumentException if drawable was already added to this animator
*/
void add(GLAutoDrawable drawable);
-
+
/**
* Removes a drawable from the animator's list of rendering drawables.
*
@@ -173,10 +173,10 @@ public interface GLAnimatorControl extends FPSCounter {
* and will not be recovered.
*
*
- * This allows the animator thread to become {@link #isAnimating() not animating},
+ * This allows the animator thread to become {@link #isAnimating() not animating},
* in case the last drawable has been removed.
*
- *
+ *
* @param drawable the drawable to be removed
* @throws IllegalArgumentException if drawable was not added to this animator
*/
diff --git a/src/jogl/classes/javax/media/opengl/GLArrayData.java b/src/jogl/classes/javax/media/opengl/GLArrayData.java
index 8e1383031..4025170cf 100644
--- a/src/jogl/classes/javax/media/opengl/GLArrayData.java
+++ b/src/jogl/classes/javax/media/opengl/GLArrayData.java
@@ -43,7 +43,7 @@ public interface GLArrayData {
* Implementation and type dependent object association.
*
* One currently known use case is to associate a {@link com.jogamp.opengl.util.glsl.ShaderState ShaderState}
- * to an GLSL aware vertex attribute object, allowing to use the ShaderState to handle it's
+ * to an GLSL aware vertex attribute object, allowing to use the ShaderState to handle it's
* data persistence, location and state change.
* This is implicitly done via {@link com.jogamp.opengl.util.glsl.ShaderState#ownAttribute(GLArrayData, boolean) shaderState.ownAttribute(GLArrayData, boolean)}.
*
@@ -51,7 +51,7 @@ public interface GLArrayData {
* @param enable pass true to enable the association and false to disable it.
*/
public void associate(Object obj, boolean enable);
-
+
/**
* Returns true if this data set is intended for a GLSL vertex shader attribute,
* otherwise false, ie intended for fixed function vertex pointer
@@ -110,7 +110,7 @@ public interface GLArrayData {
* <0 denotes an invalid location, i.e. not found or used in the given shader program.
*/
public int setLocation(GL2ES2 gl, int program);
-
+
/**
* Binds the location of the shader attribute to the given location for the unlinked shader program.
*
@@ -121,7 +121,7 @@ public interface GLArrayData {
* @return the given location
*/
public int setLocation(GL2ES2 gl, int program, int location);
-
+
/**
* Determines whether the data is server side (VBO) and enabled,
* or a client side array (false).
@@ -150,7 +150,7 @@ public interface GLArrayData {
*/
public int getVBOTarget();
-
+
/**
* The Buffer holding the data, may be null if a GPU buffer without client bound data
*/
@@ -179,7 +179,7 @@ public interface GLArrayData {
* In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position.
*/
public int getElementCount();
-
+
/**
* The currently used size in bytes.
* In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position.
@@ -187,18 +187,18 @@ public interface GLArrayData {
public int getSizeInBytes();
/**
- * True, if GL shall normalize fixed point data while converting
+ * True, if GL shall normalize fixed point data while converting
* them into float.
- *
+ *
* Default behavior (of the fixed function pipeline) is true
* for fixed point data type and false for floating point data types.
*
*/
public boolean getNormalized();
- /**
+ /**
* @return the byte offset between consecutive components
- */
+ */
public int getStride();
public String toString();
diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
index 989a61aaf..38824ce8f 100644
--- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
@@ -50,8 +50,8 @@ import jogamp.opengl.Debug;
rendering context which is associated with the GLAutoDrawable for
the lifetime of the object.
- Since the {@link GLContext} {@link GLContext#makeCurrent makeCurrent}
- implementation is synchronized, i.e. blocks if the context
+ Since the {@link GLContext} {@link GLContext#makeCurrent makeCurrent}
+ implementation is synchronized, i.e. blocks if the context
is current on another thread, the internal
{@link GLContext} for the GLAutoDrawable can be used for the event
based rendering mechanism and by end users directly.
@@ -123,7 +123,7 @@ public interface GLAutoDrawable extends GLDrawable {
* otherwise return this instance.
*/
public GLDrawable getDelegatedDrawable();
-
+
/**
* Returns the context associated with this drawable. The returned
* context will be synchronized.
@@ -135,38 +135,38 @@ public interface GLAutoDrawable extends GLDrawable {
* Associate the new context, newtCtx, to this auto-drawable.
*
* The current context will be destroyed if destroyPrevCtx is true,
- * otherwise it will be dis-associated from this auto-drawable
+ * otherwise it will be dis-associated from this auto-drawable
* via {@link GLContext#setGLDrawable(GLDrawable, boolean) setGLDrawable(null, true);} first.
*
*
- * The new context will be associated with this auto-drawable
+ * The new context will be associated with this auto-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 association.
- * The new context will be made current afterwards, if it was current before.
+ * The new context will be made current afterwards, if it was current before.
* However the user shall take extra care that no other thread
* attempts to make this context current.
*
- *
+ *
* @param newCtx the new context, maybe null for dis-association.
- * @param destroyPrevCtx if true, destroy the previous context if exists
+ * @param destroyPrevCtx if true, destroy the previous context if exists
* @return the previous GLContext, maybe null
- *
+ *
* @see GLContext#setGLDrawable(GLDrawable, boolean)
* @see GLContext#setGLReadDrawable(GLDrawable)
* @see jogamp.opengl.GLDrawableHelper#switchContext(GLDrawable, GLContext, boolean, GLContext, int)
*/
public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx);
-
+
/**
* Adds the given {@link GLEventListener listener} to the end of this drawable queue.
* The {@link GLEventListener listeners} are notified of events in the order of the queue.
*
- * The newly added listener's {@link GLEventListener#init(GLAutoDrawable) init(..)}
+ * The newly added listener's {@link GLEventListener#init(GLAutoDrawable) init(..)}
* method will be called once before any other of it's callback methods.
* See {@link #getGLEventListenerInitState(GLEventListener)} for details.
- *
+ *
* @param listener The GLEventListener object to be inserted
*/
public void addGLEventListener(GLEventListener listener);
@@ -175,10 +175,10 @@ public interface GLAutoDrawable extends GLDrawable {
* Adds the given {@link GLEventListener listener} at the given index of this drawable queue.
* The {@link GLEventListener listeners} are notified of events in the order of the queue.
*
- * The newly added listener's {@link GLEventListener#init(GLAutoDrawable) init(..)}
+ * The newly added listener's {@link GLEventListener#init(GLAutoDrawable) init(..)}
* method will be called once before any other of it's callback methods.
* See {@link #getGLEventListenerInitState(GLEventListener)} for details.
- *
+ *
* @param index Position where the listener will be inserted.
* Should be within (0 <= index && index <= size()).
* An index value of -1 is interpreted as the end of the list, size().
@@ -192,7 +192,7 @@ public interface GLAutoDrawable extends GLDrawable {
* @return The number of GLEventListener objects of this drawable queue.
*/
public int getGLEventListenerCount();
-
+
/**
* Returns the {@link GLEventListener} at the given index of this drawable queue.
* @param index Position of the listener to be returned.
@@ -202,18 +202,18 @@ public interface GLAutoDrawable extends GLDrawable {
* @throws IndexOutOfBoundsException If the index is not within (0 <= index && index < size()), or -1
*/
public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException;
-
+
/**
* Retrieves whether the given {@link GLEventListener listener} is initialized or not.
*
- * After {@link #addGLEventListener(GLEventListener) adding} a {@link GLEventListener} it is
+ * After {@link #addGLEventListener(GLEventListener) adding} a {@link GLEventListener} it is
* marked uninitialized and added to a list of to be initialized {@link GLEventListener}.
- * If such uninitialized {@link GLEventListener}'s handler methods (reshape, display)
+ * If such uninitialized {@link GLEventListener}'s handler methods (reshape, display)
* are about to be invoked, it's {@link GLEventListener#init(GLAutoDrawable) init(..)} method is invoked first.
* Afterwards the {@link GLEventListener} is marked initialized
* and removed from the list of to be initialized {@link GLEventListener}.
*
- *
+ *
* This methods returns the {@link GLEventListener} initialized state,
* i.e. returns false if it is included in the list of to be initialized {@link GLEventListener},
* otherwise true.
@@ -221,17 +221,17 @@ public interface GLAutoDrawable extends GLDrawable {
* @param listener the GLEventListener object to query it's initialized state.
*/
public boolean getGLEventListenerInitState(GLEventListener listener);
-
+
/**
* Sets the given {@link GLEventListener listener's} initialized state.
- *
+ *
* This methods allows manually setting the {@link GLEventListener} initialized state,
* i.e. adding it to, or removing it from the list of to be initialized {@link GLEventListener}.
* See {@link #getGLEventListenerInitState(GLEventListener)} for details.
*
*
* Warning: This method does not validate whether the given {@link GLEventListener listener's}
- * is member of this drawable queue, i.e. {@link #addGLEventListener(GLEventListener) added}.
+ * is member of this drawable queue, i.e. {@link #addGLEventListener(GLEventListener) added}.
*
*
* This method is only exposed to allow users full control over the {@link GLEventListener}'s state
@@ -239,16 +239,16 @@ public interface GLAutoDrawable extends GLDrawable {
*
*
* One use case is moving a {@link GLContext} and their initialized {@link GLEventListener}
- * from one {@link GLAutoDrawable} to another,
+ * from one {@link GLAutoDrawable} to another,
* where a subsequent {@link GLEventListener#init(GLAutoDrawable) init(..)} call after adding it
- * to the new owner is neither required nor desired.
+ * to the new owner is neither required nor desired.
* See {@link com.jogamp.opengl.util.GLDrawableUtil#swapGLContextAndAllGLEventListener(GLAutoDrawable, GLAutoDrawable) swapGLContextAndAllGLEventListener(..)}.
*
* @param listener the GLEventListener object to perform a state change.
- * @param initialized if true, mark the listener initialized, otherwise uninitialized.
+ * @param initialized if true, mark the listener initialized, otherwise uninitialized.
*/
public void setGLEventListenerInitState(GLEventListener listener, boolean initialized);
-
+
/**
* Disposes the given {@link GLEventListener listener} via {@link GLEventListener#dispose(GLAutoDrawable) dispose(..)}
* if it has been initialized and added to this queue.
@@ -257,7 +257,7 @@ public interface GLAutoDrawable extends GLDrawable {
* otherwise marked uninitialized.
*
*
- * 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.
*
*
@@ -268,8 +268,8 @@ public interface GLAutoDrawable extends GLDrawable {
* Use {@link #removeGLEventListener(GLEventListener) removeGLEventListener(listener)} instead
* if you just want to remove the {@link GLEventListener listener} and don't care about the disposal of the it's (OpenGL) resources.
*
- *
- * Also note that this is done from within a particular drawable's
+ *
+ * Also note that this is done from within a particular drawable's
* {@link GLEventListener} handler (reshape, display, etc.), that it is not
* guaranteed that all other listeners will be evaluated properly
* during this update cycle.
@@ -277,30 +277,30 @@ public interface GLAutoDrawable extends GLDrawable {
* @param listener The GLEventListener object to be disposed and removed if remove is true
* @param remove pass true to have the listener removed from this drawable queue, otherwise pass false
* @return the disposed and/or removed GLEventListener, or null if no action was performed, i.e. listener was not added
- */
+ */
public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove);
-
- /**
+
+ /**
* Removes the given {@link GLEventListener listener} from this drawable queue.
*
- * This is an inexpensive operation, since the removed listener's
+ * This is an inexpensive operation, since the removed listener's
* {@link GLEventListener#dispose(GLAutoDrawable) dispose(..)} method will not be called.
*
*
- * Use {@link #disposeGLEventListener(GLEventListener, boolean) disposeGLEventListener(listener, true)}
+ * Use {@link #disposeGLEventListener(GLEventListener, boolean) disposeGLEventListener(listener, true)}
* instead to ensure disposal of the {@link GLEventListener listener}'s (OpenGL) resources.
- *
- *
- * Note that if this is done from within a particular drawable's
+ *
+ *
+ * Note that if this is done from within a particular drawable's
* {@link GLEventListener} handler (reshape, display, etc.), that it is not
* guaranteed that all other listeners will be evaluated properly
* during this update cycle.
*
* @param listener The GLEventListener object to be removed
* @return the removed GLEventListener, or null if listener was not added
- */
+ */
public GLEventListener removeGLEventListener(GLEventListener listener);
-
+
/**
* Registers the usage of an animator, an {@link javax.media.opengl.GLAnimatorControl} implementation.
* The animator will be queried whether it's animating, ie periodically issuing {@link #display()} calls or not.
@@ -334,17 +334,17 @@ public interface GLAutoDrawable extends GLDrawable {
/**
* 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
@@ -359,17 +359,17 @@ public interface GLAutoDrawable extends GLDrawable {
* and spare redundant context switches, see {@link com.jogamp.opengl.util.AnimatorBase#setExclusiveContext(boolean)}.
*
* @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
* @see com.jogamp.opengl.util.AnimatorBase#setExclusiveContext(boolean)
*/
public Thread setExclusiveContextThread(Thread t) throws GLException;
-
+
/**
- * @see #setExclusiveContextThread(Thread)
+ * @see #setExclusiveContextThread(Thread)
*/
public Thread getExclusiveContextThread();
-
+
/**
* Enqueues a one-shot {@link GLRunnable},
* which will be executed within the next {@link #display()} call
@@ -391,7 +391,7 @@ public interface GLAutoDrawable extends GLDrawable {
* has been executed by the {@link GLAnimatorControl animator}, otherwise the method returns immediately.
*
*
- * If wait is trueand
+ * If wait is trueand
* {@link #isRealized()} returns falseor {@link #getContext()} returns null,
* the call is ignored and returns false.
* This helps avoiding deadlocking the caller.
@@ -404,16 +404,16 @@ public interface GLAutoDrawable extends GLDrawable {
* @param wait if true block until execution of glRunnable is finished, otherwise return immediately w/o waiting
* @param glRunnable the {@link GLRunnable} to execute within {@link #display()}
* @return true if the {@link GLRunnable} has been processed or queued, otherwise false.
- *
+ *
* @see #setAnimator(GLAnimatorControl)
* @see #display()
* @see GLRunnable
* @see #invoke(boolean, List)
*/
public boolean invoke(boolean wait, GLRunnable glRunnable);
-
+
/**
- * Extends {@link #invoke(boolean, GLRunnable)} functionality
+ * Extends {@link #invoke(boolean, GLRunnable)} functionality
* allowing to inject a list of {@link GLRunnable}s.
* @param wait if true block until execution of the last glRunnable is finished, otherwise return immediately w/o waiting
* @param glRunnables the {@link GLRunnable}s to execute within {@link #display()}
@@ -494,16 +494,16 @@ public interface GLAutoDrawable extends GLDrawable {
*
* This GLAutoDrawable implementation holds it's own GLContext reference,
* thus created a GLContext using this methods won't replace it implicitly.
- * To replace or set this GLAutoDrawable's GLContext you need to call {@link #setContext(GLContext, boolean)}.
+ * To replace or set this GLAutoDrawable's GLContext you need to call {@link #setContext(GLContext, boolean)}.
*
*
- * The GLAutoDrawable implementation shall also set the
- * context creation flags as customized w/ {@link #setContextCreationFlags(int)}.
+ * The GLAutoDrawable implementation shall also set the
+ * context creation flags as customized w/ {@link #setContextCreationFlags(int)}.
*
*/
@Override
public GLContext createContext(GLContext shareWith);
-
+
/** Returns the {@link GL} pipeline object this GLAutoDrawable uses.
If this method is called outside of the {@link
GLEventListener}'s callback methods (init, display, etc.) it may
@@ -522,13 +522,13 @@ public interface GLAutoDrawable extends GLDrawable {
demos for examples.
@return the set GL pipeline or null if not successful */
public GL setGL(GL gl);
-
+
/**
* Method may return the upstream UI toolkit object
* holding this {@link GLAutoDrawable} instance, if exist.
*
* Currently known Java UI toolkits and it's known return types are:
- *
+ *
*
- * However, the result may be other object types than the listed above
+ * However, the result may be other object types than the listed above
* due to new supported toolkits.
*
*
The base interface from which all GL profiles derive, providing
* checked conversion down to concrete profiles, access to the
- * OpenGL context associated with the GL and extension/function
+ * OpenGL context associated with the GL and extension/function
* availability queries as described below.
*
*
While the APIs for vendor extensions are unconditionally
@@ -79,7 +79,7 @@ package javax.media.opengl;
*
*/
public interface GLBase {
-
+
/**
* Indicates whether this GL object conforms to any of the OpenGL profiles.
*/
@@ -131,7 +131,7 @@ public interface GLBase {
*
* Remark: ES2 compatible desktop profiles are not included.
* To query whether core ES2 functionality is provided, use {@link #isGLES2Compatible()}.
- *
* Remark: ES3 compatible desktop profiles are not included.
* To query whether core ES3 functionality is provided, use {@link #isGLES3Compatible()}.
- *
+ *
* @see #isGLES3Compatible()
* @see GLContext#isGLES3()
*/
public boolean isGLES3();
-
+
/**
* Indicates whether this GL object conforms to one of the OpenGL ES profiles,
* see {@link #isGLES1()} and {@link #isGLES2()}.
@@ -180,7 +180,7 @@ public interface GLBase {
public boolean isGL3ES3();
/**
- * Returns true if this GL object conforms to a GL4ES3 compatible profile, i.e. if {@link #isGLES3Compatible()} returns true.
+ * Returns true if this GL object conforms to a GL4ES3 compatible profile, i.e. if {@link #isGLES3Compatible()} returns true.
*
Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]
* @see GLContext#isGL4ES3()
*/
@@ -192,29 +192,29 @@ public interface GLBase {
*/
public boolean isGL2GL3();
- /**
+ /**
* Indicates whether this GL object uses a GL4 core profile.
Includes [ GL4 ].
* @see GLContext#isGL4core()
*/
public boolean isGL4core();
-
- /**
+
+ /**
* Indicates whether this GL object uses a GL3 core profile.
Includes [ GL4, GL3 ].
* @see GLContext#isGL3core()
*/
public boolean isGL3core();
-
- /**
+
+ /**
* Indicates whether this GL object uses a GL core profile.
Includes [ GL4, GL3, GLES3, GL2ES2 ].
* @see GLContext#isGLcore()
*/
public boolean isGLcore();
-
+
/**
* Indicates whether this GL object is compatible with the core OpenGL ES2 functionality.
- * @return true if this context is an ES2 context or implements
+ * @return true if this context is an ES2 context or implements
* the extension GL_ARB_ES2_compatibility, otherwise false
- * @see GLContext#isGLES2Compatible()
+ * @see GLContext#isGLES2Compatible()
*/
public boolean isGLES2Compatible();
@@ -227,26 +227,26 @@ public interface GLBase {
*
* Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]
*
- * @see GLContext#isGLES3Compatible()
+ * @see GLContext#isGLES3Compatible()
*/
public boolean isGLES3Compatible();
- /**
- * Indicates whether this GL object supports GLSL.
- * @see GLContext#hasGLSL()
+ /**
+ * Indicates whether this GL object supports GLSL.
+ * @see GLContext#hasGLSL()
*/
public boolean hasGLSL();
/**
* Returns the downstream GL instance in case this is a wrapping pipeline, otherwise null.
*
- * See {@link #getRootGL()} for retrieving the implementing root instance.
+ * See {@link #getRootGL()} for retrieving the implementing root instance.
*
* @throws GLException if the downstream instance is not null and not a GL implementation
* @see #getRootGL()
*/
public GL getDownstreamGL() throws GLException;
-
+
/**
* Returns the implementing root instance, considering a wrapped pipelined hierarchy, see {@link #getDownstreamGL()}.
*
@@ -256,7 +256,7 @@ public interface GLBase {
* @throws GLException if the root instance is not a GL implementation
*/
public GL getRootGL() throws GLException;
-
+
/**
* Casts this object to the GL interface.
* @throws GLException if this object is not a GL implementation
@@ -360,14 +360,14 @@ public interface GLBase {
/**
* Returns true if the specified OpenGL core- or extension-function can be
* used successfully through this GL instance given the current host (OpenGL
- * client) and display (OpenGL server) configuration.
- * By "successfully" we mean that the function is both callable
- * on the machine running the program and available on the current
- * display.
+ * client) and display (OpenGL server) configuration.
+ * By "successfully" we mean that the function is both callable
+ * on the machine running the program and available on the current
+ * display.
*
* In order to call a function successfully, the function must be both
- * callable on the machine running the program and available on
- * the display device that is rendering the output (note: on non-networked,
+ * callable on the machine running the program and available on
+ * the display device that is rendering the output (note: on non-networked,
* single-display machines these two conditions are identical; on networked and/or
* multi-display machines this becomes more complicated). These conditions are
* met if the function is either part of the core OpenGL version supported by
@@ -376,7 +376,7 @@ public interface GLBase {
*
* A GL function is callable if it is successfully linked at runtime,
* hence the GLContext must be made current at least once.
- *
+ *
* @param glFunctionName the name of the OpenGL function (e.g., use
* "glBindRenderbufferEXT" or "glBindRenderbuffer" to check if {@link
* GL#glBindRenderbuffer(int,int)} is available).
@@ -386,14 +386,14 @@ public interface GLBase {
/**
* Returns true if the specified OpenGL extension can be
* used successfully through this GL instance given the current host (OpenGL
- * client) and display (OpenGL server) configuration.
+ * client) and display (OpenGL server) configuration.
*
* @param glExtensionName the name of the OpenGL extension (e.g.,
* "GL_ARB_vertex_program").
*/
public boolean isExtensionAvailable(String glExtensionName);
- /**
+ /**
* Returns true if basic FBO support is available, otherwise false.
*
* Basic FBO is supported if the context is either GL-ES >= 2.0, GL >= core 3.0 or implements the extensions
@@ -407,12 +407,12 @@ public interface GLBase {
*/
public boolean hasBasicFBOSupport();
- /**
+ /**
* Returns true if full FBO support is available, otherwise false.
*
* Full FBO is supported if the context is either GL >= core 3.0 or implements the extensions
* ARB_framebuffer_object, or all of
- * EXT_framebuffer_object, EXT_framebuffer_multisample,
+ * EXT_framebuffer_object, EXT_framebuffer_multisample,
* EXT_framebuffer_blit, GL_EXT_packed_depth_stencil.
*
*
@@ -424,7 +424,7 @@ public interface GLBase {
/**
* Returns the maximum number of FBO RENDERBUFFER samples
- * if {@link #hasFullFBOSupport() full FBO is supported}, otherwise false.
+ * if {@link #hasFullFBOSupport() full FBO is supported}, otherwise false.
* @see GLContext#getMaxRenderbufferSamples()
*/
public int getMaxRenderbufferSamples();
@@ -440,7 +440,7 @@ public interface GLBase {
public boolean isNPOTTextureAvailable();
public boolean isTextureFormatBGRA8888Available();
-
+
/** Provides a platform-independent way to specify the minimum swap
interval for buffer swaps. An argument of 0 disables
sync-to-vertical-refresh completely, while an argument of 1
@@ -449,7 +449,7 @@ public interface GLBase {
is usually either 0 or 1. This function is not guaranteed to
have an effect, and in particular only affects heavyweight
onscreen components.
-
+
@see #getSwapInterval
@throws GLException if this context is not the current
*/
@@ -458,8 +458,8 @@ public interface GLBase {
/** Provides a platform-independent way to get the swap
interval set by {@link #setSwapInterval}.
- If the interval is not set by {@link #setSwapInterval} yet,
- -1 is returned, indicating that the platforms default
+ If the interval is not set by {@link #setSwapInterval} yet,
+ -1 is returned, indicating that the platforms default
is being used.
@see #setSwapInterval
@@ -498,10 +498,10 @@ public interface GLBase {
*/
public Object getExtension(String extensionName);
- /** Aliased entrypoint of void {@native glClearDepth}(GLclampd depth); and void {@native glClearDepthf}(GLclampf depth); . */
+ /** Aliased entrypoint of void {@native glClearDepth}(GLclampd depth); and void {@native glClearDepthf}(GLclampf depth); . */
public void glClearDepth( double depth );
- /** Aliased entrypoint of void {@native glDepthRange}(GLclampd depth); and void {@native glDepthRangef}(GLclampf depth); . */
+ /** Aliased entrypoint of void {@native glDepthRange}(GLclampd depth); and void {@native glDepthRangef}(GLclampf depth); . */
public void glDepthRange(double zNear, double zFar);
/**
@@ -526,44 +526,44 @@ public interface GLBase {
*/
public boolean glIsVBOElementArrayBound();
- /**
- * Return the framebuffer name bound to this context,
+ /**
+ * Return the framebuffer name bound to this context,
* see {@link GL#glBindFramebuffer(int, int)}.
*/
public int getBoundFramebuffer(int target);
- /**
+ /**
* Return the default draw framebuffer name.
- *
+ *
* May differ from it's default zero
* in case an framebuffer object ({@link com.jogamp.opengl.FBObject}) based drawable
* is being used.
- *
+ *
*/
public int getDefaultDrawFramebuffer();
- /**
+ /**
* Return the default read framebuffer name.
- *
+ *
* May differ from it's default zero
* in case an framebuffer object ({@link com.jogamp.opengl.FBObject}) based drawable
* is being used.
- *
+ *
*/
public int getDefaultReadFramebuffer();
-
- /**
- * Returns the default color buffer within the current bound
+
+ /**
+ * Returns the default color buffer within the current bound
* {@link #getDefaultReadFramebuffer()}, i.e. GL_READ_FRAMEBUFFER,
- * which will be used as the source for pixel reading commands,
+ * which will be used as the source for pixel reading commands,
* like {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer)} etc.
*
* For offscreen framebuffer objects this is {@link GL#GL_COLOR_ATTACHMENT0},
- * otherwise this is {@link GL#GL_FRONT} for single buffer configurations
+ * otherwise this is {@link GL#GL_FRONT} for single buffer configurations
* and {@link GL#GL_BACK} for double buffer configurations.
- *
+ *
*/
public int getDefaultReadBuffer();
-
+
}
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilities.java b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
index 872069fb8..b825d6388 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilities.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
@@ -99,7 +99,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
}
/**
- * Copies all {@link GLCapabilities} and {@link Capabilities} values
+ * Copies all {@link GLCapabilities} and {@link Capabilities} values
* from source into this instance.
* @return this instance
*/
@@ -122,11 +122,11 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
sampleExtension = source.getSampleExtension();
return this;
}
-
+
@Override
public int hashCode() {
// 31 * x == (x << 5) - x
- int hash = super.hashCode();
+ int hash = super.hashCode();
hash = ((hash << 5) - hash) + this.glProfile.hashCode() ;
hash = ((hash << 5) - hash) + ( this.hardwareAccelerated ? 1 : 0 );
hash = ((hash << 5) - hash) + ( this.stereo ? 1 : 0 );
@@ -238,7 +238,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
public void setGLProfile(GLProfile profile) {
glProfile=profile;
}
-
+
@Override
public final boolean isPBuffer() {
return isPBuffer;
@@ -255,7 +255,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
*
* Requesting offscreen pbuffer mode disables the offscreen auto selection.
*
- */
+ */
public void setPBuffer(boolean enable) {
if(enable) {
setOnscreen(false);
@@ -267,7 +267,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
public final boolean isFBO() {
return isFBO;
}
-
+
/**
* Requesting offscreen FBO mode.
*
@@ -422,7 +422,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
return sampleBuffers;
}
- /**
+ /**
* If sample buffers are enabled, indicates the number of buffers
* to be allocated. Defaults to 2.
* @see #getNumSamples()
@@ -491,7 +491,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
if(isOnscreen()) {
sink.append("."); // no additional off-screen modes besides on-screen
} else {
- sink.append("auto-cfg"); // auto-config off-screen mode
+ sink.append("auto-cfg"); // auto-config off-screen mode
}
}
sink.append("]");
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java
index 5d575c2ee..2e0bec1f9 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* 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.
*/
@@ -53,7 +53,7 @@ import javax.media.opengl.GLCapabilitiesImmutable;
the appropriate method of {@link GLDrawableFactory}; the chooser
will be called during the OpenGL context creation process. Note
that this is only a marker interface; its signature is the same as
- {@link CapabilitiesChooser} and the {@link List} of
+ {@link CapabilitiesChooser} and the {@link List} of
objects extending {@link CapabilitiesImmutable}
passed to {@link #chooseCapabilities chooseCapabilities}
is actually a {@link List} of type {@link GLCapabilitiesImmutable}. */
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilitiesImmutable.java b/src/jogl/classes/javax/media/opengl/GLCapabilitiesImmutable.java
index 6af35021f..dc28539a0 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilitiesImmutable.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilitiesImmutable.java
@@ -37,13 +37,13 @@ import javax.media.nativewindow.CapabilitiesImmutable;
* @see javax.media.nativewindow.CapabilitiesImmutable
*/
public interface GLCapabilitiesImmutable extends CapabilitiesImmutable {
- /**
- * One of the platform's default sample extension
+ /**
+ * One of the platform's default sample extension
* EGL.EGL_SAMPLES, GLX.GLX_SAMPLES, WGLExt.WGL_SAMPLES_ARB
* if available, or any other known fallback one, ie EGLExt.EGL_COVERAGE_SAMPLES_NV
*/
public static final String DEFAULT_SAMPLE_EXTENSION = "default" ;
-
+
/**
* Returns the GL profile you desire or used by the drawable.
*/
@@ -110,10 +110,10 @@ public interface GLCapabilitiesImmutable extends CapabilitiesImmutable {
*
*/
String getSampleExtension();
-
+
/**
* Returns whether sample buffers for full-scene antialiasing
- * (FSAA) should be allocated for this drawable.
+ * (FSAA) should be allocated for this drawable.
*
* Default is false.
*
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index f4dbde6b2..bd6867359 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -72,14 +72,14 @@ import com.jogamp.opengl.GLRendererQuirks;
abstraction provides a stable object which clients can use to
refer to a given context. */
public abstract class GLContext {
-
+
public static final boolean DEBUG = Debug.debug("GLContext");
public static final boolean TRACE_SWITCH = Debug.isPropertyDefined("jogl.debug.GLContext.TraceSwitch", true);
- public static final boolean DEBUG_TRACE_SWITCH = DEBUG || TRACE_SWITCH;
+ public static final boolean DEBUG_TRACE_SWITCH = DEBUG || TRACE_SWITCH;
- /**
- * If true (default), bootstrapping the available GL profiles
- * will use the highest compatible GL context for each profile,
+ /**
+ * If true (default), bootstrapping the available GL profiles
+ * will use the highest compatible GL context for each profile,
* hence skipping querying lower profiles if a compatible higher one is found:
*
*
4.2-core -> 4.2-core, 3.3-core
@@ -95,17 +95,17 @@ public abstract class GLContext {
*
* Using aliasing speeds up initialization about:
*
- *
Linux x86_64 - Nvidia: 28%, 700ms down to 500ms
- *
Linux x86_64 - AMD : 40%, 1500ms down to 900ms
+ *
Linux x86_64 - Nvidia: 28%, 700ms down to 500ms
+ *
Linux x86_64 - AMD : 40%, 1500ms down to 900ms
*
* Can be turned off with property jogl.debug.GLContext.NoProfileAliasing.
*
*/
public static final boolean PROFILE_ALIASING = !Debug.isPropertyDefined("jogl.debug.GLContext.NoProfileAliasing", true);
-
+
protected static final boolean FORCE_NO_FBO_SUPPORT = Debug.isPropertyDefined("jogl.fbo.force.none", true);
protected static final boolean FORCE_MIN_FBO_SUPPORT = Debug.isPropertyDefined("jogl.fbo.force.min", true);
-
+
/** Reflects property jogl.debug.DebugGL. If true, the debug pipeline is enabled at context creation. */
public static final boolean DEBUG_GL = Debug.isPropertyDefined("jogl.debug.DebugGL", true);
/** Reflects property jogl.debug.TraceGL. If true, the trace pipeline is enabled at context creation. */
@@ -130,31 +130,31 @@ public abstract class GLContext {
public static final VersionNumber Version140 = new VersionNumber(1, 40, 0);
/* Version 1.50, i.e. GLSL 1.50 for GL 3.2. */
public static final VersionNumber Version150 = new VersionNumber(1, 50, 0);
-
+
/** Version 3.0. As an OpenGL version, it qualifies for desktop {@link #isGL2()} only, or ES 3.0. */
public static final VersionNumber Version300 = new VersionNumber(3, 0, 0);
-
+
/** Version 3.1. As an OpenGL version, it qualifies for {@link #isGL3core()}, {@link #isGL3bc()} and {@link #isGL3()} */
public static final VersionNumber Version310 = new VersionNumber(3, 1, 0);
-
+
/** Version 3.2. As an OpenGL version, it qualifies for geometry shader */
public static final VersionNumber Version320 = new VersionNumber(3, 2, 0);
-
+
/** Version 4.3. As an OpenGL version, it qualifies for GL_ARB_ES3_compatibility */
public static final VersionNumber Version430 = new VersionNumber(4, 3, 0);
-
+
protected static final VersionNumber Version800 = new VersionNumber(8, 0, 0);
//
// Cached keys, bits [0..15]
//
-
+
/** Context option bits, full bit mask covering bits [0..15], i.e. 0x0000FFFF, {@value}. */
protected static final int CTX_IMPL_FULL_MASK = 0x0000FFFF;
-
+
/** Context option bits, cached bit mask covering 9 bits [0..8], i.e. 0x000001FF, {@value}. Leaving 7 bits for non cached options, i.e. 9:7. */
protected static final int CTX_IMPL_CACHE_MASK = 0x000001FF;
-
+
/** ARB_create_context related: created via ARB_create_context. Cache key value. See {@link #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)}. */
protected static final int CTX_IS_ARB_CREATED = 1 << 0;
/** ARB_create_context related: desktop compatibility profile. Cache key value. See {@link #isGLCompatibilityProfile()}, {@link #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)}. */
@@ -173,14 +173,14 @@ public abstract class GLContext {
//
// Non cached keys, bits [9..15]
//
-
+
/** GL_ARB_ES2_compatibility implementation related: Context is compatible w/ ES2. Not a cache key. See {@link #isGLES2Compatible()}, {@link #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)}. */
protected static final int CTX_IMPL_ES2_COMPAT = 1 << 9;
/** GL_ARB_ES3_compatibility implementation related: Context is compatible w/ ES3. Not a cache key. See {@link #isGLES3Compatible()}, {@link #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)}. */
protected static final int CTX_IMPL_ES3_COMPAT = 1 << 10;
-
- /**
+
+ /**
* Context supports basic FBO, details see {@link #hasBasicFBOSupport()}.
* Not a cache key.
* @see #hasBasicFBOSupport()
@@ -188,15 +188,15 @@ public abstract class GLContext {
*/
protected static final int CTX_IMPL_FBO = 1 << 11;
- /**
- * Context supports OES_single_precision, fp32, fixed function point (FFP) compatibility entry points,
+ /**
+ * Context supports OES_single_precision, fp32, fixed function point (FFP) compatibility entry points,
* see {@link #hasFP32CompatAPI()}.
* Not a cache key.
* @see #hasFP32CompatAPI()
* @see #getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)
*/
protected static final int CTX_IMPL_FP32_COMPAT_API = 1 << 12;
-
+
private static final ThreadLocal currentContext = new ThreadLocal();
private final HashMap attachedObjects = new HashMap();
@@ -219,9 +219,9 @@ public abstract class GLContext {
private int currentSwapInterval;
protected GLRendererQuirks glRendererQuirks;
- /** Did the drawable association changed ? see {@link GLRendererQuirks#NoSetSwapIntervalPostRetarget} */
- protected boolean drawableRetargeted;
-
+ /** Did the drawable association changed ? see {@link GLRendererQuirks#NoSetSwapIntervalPostRetarget} */
+ protected boolean drawableRetargeted;
+
/**
* @param isInit true if called for class initialization, otherwise false (re-init or destruction).
*/
@@ -242,12 +242,12 @@ public abstract class GLContext {
drawableRetargeted = false;
}
- /**
+ /**
* Returns the instance of {@link GLRendererQuirks}, allowing one to determine workarounds.
* @return instance of {@link GLRendererQuirks} if context was made current once, otherwise null.
*/
public final GLRendererQuirks getRendererQuirks() { return glRendererQuirks; }
-
+
/**
* Returns true if the quirk exist in {@link #getRendererQuirks()}, otherwise false.
*
@@ -260,10 +260,10 @@ public abstract class GLContext {
* @param quirk the quirk to be tested, e.g. {@link GLRendererQuirks#NoDoubleBufferedPBuffer}.
* @throws IllegalArgumentException if the quirk is out of range
*/
- public final boolean hasRendererQuirk(int quirk) throws IllegalArgumentException {
- return null != glRendererQuirks ? glRendererQuirks.exist(quirk) : false ;
+ public final boolean hasRendererQuirk(int quirk) throws IllegalArgumentException {
+ return null != glRendererQuirks ? glRendererQuirks.exist(quirk) : false ;
}
-
+
/**
* Sets the read/write drawable for framebuffer operations.
*
@@ -276,13 +276,13 @@ public abstract class GLContext {
* attempts to make this context current. Otherwise a race condition may happen.
*
* @param readWrite The read/write drawable for framebuffer operations, maybe null to remove association.
- * @param setWriteOnly Only change the write-drawable, if setWriteOnly is true and
- * if the {@link #getGLReadDrawable() read-drawable} differs
- * from the {@link #getGLDrawable() write-drawable}.
+ * @param setWriteOnly Only change the write-drawable, if setWriteOnly is true and
+ * if the {@link #getGLReadDrawable() read-drawable} differs
+ * from the {@link #getGLDrawable() write-drawable}.
* Otherwise set both drawables, read and write.
* @return The previous read/write drawable
*
- * @throws GLException in case null is being passed or
+ * @throws GLException in case null is being passed or
* this context is made current on another thread.
*
* @see #isGLReadDrawableAvailable()
@@ -292,13 +292,13 @@ public abstract class GLContext {
* @see #getGLDrawable()
*/
public abstract GLDrawable setGLDrawable(GLDrawable readWrite, boolean setWriteOnly);
-
+
/**
* Returns the write-drawable this context uses for framebuffer operations.
*
* If the read-drawable has not been changed manually via {@link #setGLReadDrawable(GLDrawable)},
* it equals to the write-drawable (default).
- *
+ *
* @see #setGLDrawable(GLDrawable, boolean)
* @see #setGLReadDrawable(GLDrawable)
*/
@@ -336,10 +336,10 @@ public abstract class GLContext {
*
* If the read-drawable has not been changed manually via {@link #setGLReadDrawable(GLDrawable)},
* it equals to the write-drawable (default).
- *
* A return value of {@link #CONTEXT_CURRENT_NEW}
- * indicates that that context has been made current for the 1st time,
+ * indicates that that context has been made current for the 1st time,
* or that the state of the underlying context or drawable has
- * changed since the last time this context was current.
+ * changed since the last time this context was current.
* In this case, the application may wish to initialize the render state.
*
*
@@ -378,7 +378,7 @@ public abstract class GLContext {
*
*
* @return
- *
{@link #CONTEXT_CURRENT_NEW} if the context was successfully made current the 1st time,
+ *
{@link #CONTEXT_CURRENT_NEW} if the context was successfully made current the 1st time,
*
{@link #CONTEXT_CURRENT} if the context was successfully made current,
*
{@link #CONTEXT_NOT_CURRENT} if the context could not be made current.
*
@@ -514,7 +514,7 @@ public abstract class GLContext {
public abstract void destroy();
/**
- * Returns the implementing root GL instance of this GLContext's GL object,
+ * Returns the implementing root GL instance of this GLContext's GL object,
* considering a wrapped pipelined hierarchy, see {@link GLBase#getDownstreamGL()}.
* @throws GLException if the root instance is not a GL implementation
* @see GLBase#getRootGL()
@@ -523,7 +523,7 @@ public abstract class GLContext {
* @see #setGL(GL)
*/
public abstract GL getRootGL();
-
+
/**
* Returns the GL pipeline object for this GLContext.
*
@@ -716,16 +716,16 @@ public abstract class GLContext {
}
/**
- * Returns this context OpenGL version.
- * @see #getGLSLVersionNumber()
+ * Returns this context OpenGL version.
+ * @see #getGLSLVersionNumber()
**/
public final VersionNumber getGLVersionNumber() { return ctxVersion; }
- /**
+ /**
* Returns the vendor's version, i.e. version number at the end of GL_VERSION not being the GL version.
*
- * In case no such version exists within GL_VERSION,
+ * In case no such version exists within GL_VERSION,
* the {@link VersionNumberString#zeroVersion zero version} instance is returned.
- *
+ *
*
* The vendor's version is usually the vendor's OpenGL driver version.
*
@@ -743,31 +743,31 @@ public abstract class GLContext {
* via {@link GL2ES2#GL_SHADING_LANGUAGE_VERSION} if ≥ ES2.0 or GL2.0,
* otherwise a static match is being utilized.
*
- * The context must have been current once,
- * otherwise the {@link VersionNumberString#zeroVersion zero version} instance is returned.
+ * The context must have been current once,
+ * otherwise the {@link VersionNumberString#zeroVersion zero version} instance is returned.
*
* Matching could also refer to the maximum GLSL version usable by this context
* since normal GL implementations are capable of using a lower GLSL version as well.
- * The latter is not true on OSX w/ a GL3 context.
+ * The latter is not true on OSX w/ a GL3 context.
*
- *
- * @return GLSL version number if context has been made current at least once,
+ *
+ * @return GLSL version number if context has been made current at least once,
* otherwise the {@link VersionNumberString#zeroVersion zero version} instance is returned.
- *
+ *
* @see #getGLVersionNumber()
*/
public final VersionNumber getGLSLVersionNumber() {
return ctxGLSLVersion;
}
-
+
/**
* Returns the GLSL version string as to be used in a shader program, including a terminating newline '\n',
* i.e. for desktop
@@ -794,10 +794,10 @@ public abstract class GLContext {
return "";
}
final int minor = ctxGLSLVersion.getMinor();
- final String esSuffix = isGLES() && ctxGLSLVersion.compareTo(Version300) >= 0 ? " es" : "";
+ final String esSuffix = isGLES() && ctxGLSLVersion.compareTo(Version300) >= 0 ? " es" : "";
return "#version " + ctxGLSLVersion.getMajor() + ( minor < 10 ? "0"+minor : minor ) + esSuffix + "\n" ;
}
-
+
protected static final VersionNumber getStaticGLSLVersionNumber(int glMajorVersion, int glMinorVersion, int ctxOptions) {
if( 0 != ( CTX_PROFILE_ES & ctxOptions ) ) {
if( 3 > glMajorVersion ) {
@@ -814,13 +814,13 @@ public abstract class GLContext {
switch ( glMinorVersion ) {
case 0: return Version130; // GL 3.0 -> GLSL 1.30
case 1: return Version140; // GL 3.1 -> GLSL 1.40
- default: return Version150; // GL 3.2 -> GLSL 1.50
+ default: return Version150; // GL 3.2 -> GLSL 1.50
}
}
// The new default: GL >= 3.3, ES >= 3.0
return new VersionNumber(glMajorVersion, glMinorVersion * 10, 0); // GL M.N -> GLSL M.N
}
-
+
/**
* @return true if this context is an ES2 context or implements
* the extension GL_ARB_ES3_compatibility or GL_ARB_ES2_compatibility, otherwise false
@@ -840,18 +840,18 @@ public abstract class GLContext {
return 0 != ( ctxOptions & CTX_IMPL_ES3_COMPAT ) ;
}
- /**
+ /**
* @return true if impl. is a hardware rasterizer, otherwise false.
* @see #isHardwareRasterizer(AbstractGraphicsDevice, GLProfile)
- * @see GLProfile#isHardwareRasterizer()
+ * @see GLProfile#isHardwareRasterizer()
*/
public final boolean isHardwareRasterizer() {
return 0 == ( ctxOptions & CTX_IMPL_ACCEL_SOFT ) ;
}
-
+
/**
* @return true if context supports GLSL, i.e. is either {@link #isGLES2()}, {@link #isGL3()} or {@link #isGL2()} and major-version > 1.
- * @see GLProfile#hasGLSL()
+ * @see GLProfile#hasGLSL()
*/
public final boolean hasGLSL() {
return isGLES2() ||
@@ -859,7 +859,7 @@ public abstract class GLContext {
isGL2() && ctxVersion.getMajor()>1 ;
}
- /**
+ /**
* Returns true if basic FBO support is available, otherwise false.
*
* Basic FBO is supported if the context is either GL-ES >= 2.0, GL >= core 3.0 or implements the extensions
@@ -875,30 +875,30 @@ public abstract class GLContext {
return 0 != ( ctxOptions & CTX_IMPL_FBO ) ;
}
- /**
- * Returns true if OES_single_precision, fp32, fixed function point (FFP) compatibility entry points available,
+ /**
+ * Returns true if OES_single_precision, fp32, fixed function point (FFP) compatibility entry points available,
* otherwise false.
* @see #CTX_IMPL_FP32_COMPAT_API
*/
public final boolean hasFP32CompatAPI() {
return 0 != ( ctxOptions & CTX_IMPL_FP32_COMPAT_API ) ;
}
-
- /**
+
+ /**
* Returns true if full FBO support is available, otherwise false.
*
* Full FBO is supported if the context is either GL >= core 3.0 or implements the extensions
* ARB_framebuffer_object, or all of
- * EXT_framebuffer_object, EXT_framebuffer_multisample,
+ * EXT_framebuffer_object, EXT_framebuffer_multisample,
* EXT_framebuffer_blit, GL_EXT_packed_depth_stencil.
*
*
* Full FBO support includes multiple color attachments and multisampling.
*
*/
- public final boolean hasFullFBOSupport() {
+ public final boolean hasFullFBOSupport() {
return hasBasicFBOSupport() && !hasRendererQuirk(GLRendererQuirks.NoFullFBOSupport) &&
- ( isGL3() || // GL >= 3.0
+ ( isGL3() || // GL >= 3.0
isExtensionAvailable(GLExtensions.ARB_framebuffer_object) || // ARB_framebuffer_object
( isExtensionAvailable(GLExtensions.EXT_framebuffer_object) && // All EXT_framebuffer_object*
isExtensionAvailable(GLExtensions.EXT_framebuffer_multisample) &&
@@ -907,10 +907,10 @@ public abstract class GLContext {
)
) ;
}
-
+
/**
* Returns the maximum number of FBO RENDERBUFFER samples
- * if {@link #hasFullFBOSupport() full FBO is supported}, otherwise false.
+ * if {@link #hasFullFBOSupport() full FBO is supported}, otherwise false.
*/
public final int getMaxRenderbufferSamples() {
if( hasFullFBOSupport() ) {
@@ -928,7 +928,7 @@ public abstract class GLContext {
}
return 0;
}
-
+
/** Note: The GL impl. may return a const value, ie {@link GLES2#isNPOTTextureAvailable()} always returns true. */
public boolean isNPOTTextureAvailable() {
return isGL3() || isGLES2Compatible() || isExtensionAvailable(GLExtensions.ARB_texture_non_power_of_two);
@@ -940,9 +940,9 @@ public abstract class GLContext {
isExtensionAvailable(GLExtensions.IMG_texture_format_BGRA8888) ;
}
- /**
+ /**
* Indicates whether this GLContext is capable of GL4bc.
Includes [ GL4bc ].
- * @see GLProfile#isGL4bc()
+ * @see GLProfile#isGL4bc()
*/
public final boolean isGL4bc() {
return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
@@ -950,9 +950,9 @@ public abstract class GLContext {
ctxVersion.getMajor() >= 4;
}
- /**
+ /**
* Indicates whether this GLContext is capable of GL4.
Includes [ GL4bc, GL4 ].
- * @see GLProfile#isGL4()
+ * @see GLProfile#isGL4()
*/
public final boolean isGL4() {
return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
@@ -960,7 +960,7 @@ public abstract class GLContext {
ctxVersion.getMajor() >= 4;
}
- /**
+ /**
* Indicates whether this GLContext uses a GL4 core profile.
Includes [ GL4 ].
*/
public final boolean isGL4core() {
@@ -968,10 +968,10 @@ public abstract class GLContext {
0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
ctxVersion.getMajor() >= 4;
}
-
- /**
+
+ /**
* Indicates whether this GLContext is capable of GL3bc.
Includes [ GL4bc, GL3bc ].
- * @see GLProfile#isGL3bc()
+ * @see GLProfile#isGL3bc()
*/
public final boolean isGL3bc() {
return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
@@ -979,17 +979,17 @@ public abstract class GLContext {
ctxVersion.compareTo(Version310) >= 0 ;
}
- /**
+ /**
* Indicates whether this GLContext is capable of GL3.
*/
public final boolean isGL3core() {
@@ -997,8 +997,8 @@ public abstract class GLContext {
0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
ctxVersion.compareTo(Version310) >= 0;
}
-
- /**
+
+ /**
* Indicates whether this GLContext uses a GL core profile.
Includes [ GL4, GL3, GLES3, GLES2 ].
*/
public final boolean isGLcore() {
@@ -1008,26 +1008,26 @@ public abstract class GLContext {
ctxVersion.compareTo(Version310) >= 0
) ;
}
-
+
/**
* Indicates whether this GLContext allows CPU data sourcing (indices, vertices ..) as opposed to using a GPU buffer source (VBO),
- * e.g. {@link GL2#glDrawElements(int, int, int, java.nio.Buffer)}.
+ * e.g. {@link GL2#glDrawElements(int, int, int, java.nio.Buffer)}.
*
See Bug 852 - https://jogamp.org/bugzilla/show_bug.cgi?id=852
*/
public final boolean isCPUDataSourcingAvail() {
return isGL2ES1() || isGLES2();
}
-
- /**
- * Indicates whether this GLContext's native profile does not implement a default vertex array object (VAO),
+
+ /**
+ * Indicates whether this GLContext's native profile does not implement a default vertex array object (VAO),
* starting w/ OpenGL 3.1 core and GLES3.
*
Includes [ GL4, GL3, GLES3 ].
*
Due to GL 3.1 core spec: E.1. DEPRECATED AND REMOVED FEATURES (p 296),
GL 3.2 core spec: E.2. DEPRECATED AND REMOVED FEATURES (p 331)
there is no more default VAO buffer 0 bound, hence generating and binding one
- to avoid INVALID_OPERATION at VertexAttribPointer.
+ to avoid INVALID_OPERATION at VertexAttribPointer.
More clear is GL 4.3 core spec: 10.4 (p 307).
*
*
@@ -1047,87 +1047,87 @@ public abstract class GLContext {
ctxVersion.compareTo(Version310) >= 0
) ;
}
-
+
/**
* If this GLContext does not implement a default VAO, see {@link #hasNoDefaultVAO()},
* an own default VAO will be created and bound at context creation.
*
* If this GLContext does implement a default VAO, i.e. {@link #hasNoDefaultVAO()}
* returns false, this method returns 0.
- *
+ *
*
* Otherwise this method returns the VAO object name
- * representing this GLContext's own default VAO.
- *
+ * representing this GLContext's own default VAO.
+ *
* @see #hasNoDefaultVAO()
*/
public abstract int getDefaultVAO();
- /**
+ /**
* Indicates whether this GLContext is capable of GL2.
Includes [ GL4bc, GL3bc, GL2 ].
- * @see GLProfile#isGL2()
+ * @see GLProfile#isGL2()
*/
public final boolean isGL2() {
return 0 != ( ctxOptions & CTX_PROFILE_COMPAT ) && ctxVersion.getMajor()>=1 ;
}
- /**
+ /**
* Indicates whether this GLContext is capable of GL2GL3.
Includes [ GL4bc, GL4, GL3bc, GL3, GL2, GL2GL3 ].
- * @see GLProfile#isGL2GL3()
- */
+ * @see GLProfile#isGL2GL3()
+ */
public final boolean isGL2GL3() {
return isGL2() || isGL3();
}
- /**
+ /**
* Indicates whether this GLContext is capable of GLES1.
Includes [ GLES1 ].
- * @see GLProfile#isGLES1()
+ * @see GLProfile#isGLES1()
*/
public final boolean isGLES1() {
return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 1 ;
}
/**
- * Indicates whether this GLContext is capable of GLES2.
Includes [ GLES2 ].
- * @see GLProfile#isGLES2()
+ * Indicates whether this GLContext is capable of GLES2.
Includes [ GLES2 ].
+ * @see GLProfile#isGLES2()
*/
public final boolean isGLES2() {
return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 2 ;
}
- /**
+ /**
* Indicates whether this GLContext is capable of GLES3.
Includes [ GLES3 ].
- * @see GLProfile#isGLES3()
+ * @see GLProfile#isGLES3()
*/
public final boolean isGLES3() {
return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 3 ;
}
- /**
+ /**
* Indicates whether this GLContext is capable of GLES.
Includes [ GLES3, GLES1, GLES2 ].
- * @see GLProfile#isGLES()
+ * @see GLProfile#isGLES()
*/
public final boolean isGLES() {
return 0 != ( CTX_PROFILE_ES & ctxOptions ) ;
}
- /**
+ /**
* Indicates whether this GLContext is capable of GL2ES1.
Includes [ GL4bc, GL3bc, GL2, GLES1, GL2ES1 ].
- * @see GLProfile#isGL2ES1()
+ * @see GLProfile#isGL2ES1()
*/
public final boolean isGL2ES1() {
return isGLES1() || isGL2();
}
- /**
+ /**
* Indicates whether this GLContext is capable of GL2ES2.
* @see GLProfile#isGL2ES3()
* @see #isGL3ES3()
@@ -1137,16 +1137,16 @@ public abstract class GLContext {
return isGL3ES3() || isGL2GL3();
}
- /**
+ /**
* Indicates whether this GLContext is capable of GL3ES3.
Includes [ GL4bc, GL4, GL3bc, GL3, GLES3 ].
- * @see GLProfile#isGL3ES3()
+ * @see GLProfile#isGL3ES3()
*/
public final boolean isGL3ES3() {
return isGL4ES3() || isGL3();
}
- /**
- * Returns true if this profile is capable of GL4ES3, i.e. if {@link #isGLES3Compatible()} returns true.
+ /**
+ * Returns true if this profile is capable of GL4ES3, i.e. if {@link #isGLES3Compatible()} returns true.
*
Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]
* @see GLProfile#isGL4ES3()
*/
@@ -1185,7 +1185,7 @@ public abstract class GLContext {
*
*
* For a valid context the default value is 1
- * in case of an EGL based profile (ES1 or ES2) and -1
+ * in case of an EGL based profile (ES1 or ES2) and -1
* (undefined) for desktop.
*
*/
@@ -1222,51 +1222,51 @@ public abstract class GLContext {
}
protected boolean bindSwapBarrierImpl(int group, int barrier) { /** nop per default .. **/ return false; }
- /**
- * Return the framebuffer name bound to this context,
+ /**
+ * Return the framebuffer name bound to this context,
* see {@link GL#glBindFramebuffer(int, int)}.
*/
public abstract int getBoundFramebuffer(int target);
-
- /**
+
+ /**
* Return the default draw framebuffer name.
- *
+ *
* May differ from it's default zero
* in case an framebuffer object ({@link com.jogamp.opengl.FBObject}) based drawable
* is being used.
- *
+ *
*/
public abstract int getDefaultDrawFramebuffer();
-
- /**
+
+ /**
* Return the default read framebuffer name.
- *
+ *
* May differ from it's default zero
* in case an framebuffer object ({@link com.jogamp.opengl.FBObject}) based drawable
* is being used.
- *
+ *
*/
public abstract int getDefaultReadFramebuffer();
-
- /**
- * Returns the default color buffer within the current bound
- * {@link #getDefaultReadFramebuffer()}, i.e. GL_READ_FRAMEBUFFER​,
- * which will be used as the source for pixel reading commands,
+
+ /**
+ * Returns the default color buffer within the current bound
+ * {@link #getDefaultReadFramebuffer()}, i.e. GL_READ_FRAMEBUFFER​,
+ * which will be used as the source for pixel reading commands,
* like {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer)} etc.
*
* For offscreen framebuffer objects this is {@link GL#GL_COLOR_ATTACHMENT0},
- * otherwise this is {@link GL#GL_FRONT} for single buffer configurations
+ * otherwise this is {@link GL#GL_FRONT} for single buffer configurations
* and {@link GL#GL_BACK} for double buffer configurations.
- *
+ *
*/
public abstract int getDefaultReadBuffer();
-
+
/** Get the default pixel data type, as required by e.g. {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer)}. */
public abstract int getDefaultPixelDataType();
-
+
/** Get the default pixel data format, as required by e.g. {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer)}. */
public abstract int getDefaultPixelDataFormat();
-
+
/**
* @return The extension implementing the GLDebugOutput feature,
* either {@link GLExtensions#ARB_debug_output} or {@link GLExtensions#AMD_debug_output}.
@@ -1486,13 +1486,13 @@ public abstract class GLContext {
}
if (DEBUG) {
System.err.println(getThreadName() + ": createContextARB: SET mappedVersionsAvailableSet "+devKey);
- System.err.println(GLContext.dumpAvailableGLVersions(null).toString());
+ System.err.println(GLContext.dumpAvailableGLVersions(null).toString());
}
}
}
- /**
- * Returns a unique String object using {@link String#intern()} for the given arguments,
+ /**
+ * Returns a unique String object using {@link String#intern()} for the given arguments,
* which object reference itself can be used as a key.
*/
protected static String getDeviceVersionAvailableKey(AbstractGraphicsDevice device, int major, int profile) {
@@ -1575,7 +1575,7 @@ public abstract class GLContext {
}
return val;
}
-
+
/**
* @param reqMajor Key Value either 1, 2, 3 or 4
* @param reqProfile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
@@ -1647,7 +1647,7 @@ public abstract class GLContext {
reqMajorCTP[1]=CTX_PROFILE_CORE;
}
}
-
+
/**
* @param device the device the context profile is being requested for
* @param GLProfile the GLProfile the context profile is being requested for
@@ -1656,7 +1656,7 @@ public abstract class GLContext {
protected static final int getAvailableContextProperties(final AbstractGraphicsDevice device, final GLProfile glp) {
final int[] reqMajorCTP = new int[] { 0, 0 };
getRequestMajorAndCompat(glp, reqMajorCTP);
-
+
int _major[] = { 0 };
int _minor[] = { 0 };
int _ctp[] = { 0 };
@@ -1702,7 +1702,7 @@ public abstract class GLContext {
* Returns true if it is possible to create an framebuffer object (FBO).
*
* FBO feature is implemented in OpenGL, hence it is {@link GLProfile} dependent.
- *
+ *
*
* FBO support is queried as described in {@link #hasBasicFBOSupport()}.
*
@@ -1714,16 +1714,16 @@ public abstract class GLContext {
public static final boolean isFBOAvailable(AbstractGraphicsDevice device, GLProfile glp) {
return 0 != ( CTX_IMPL_FBO & getAvailableContextProperties(device, glp) );
}
-
+
/**
- * @return 1 if using a hardware rasterizer, 0 if using a software rasterizer and -1 if not determined yet.
+ * @return 1 if using a hardware rasterizer, 0 if using a software rasterizer and -1 if not determined yet.
* @see GLContext#isHardwareRasterizer()
- * @see GLProfile#isHardwareRasterizer()
+ * @see GLProfile#isHardwareRasterizer()
*/
public static final int isHardwareRasterizer(AbstractGraphicsDevice device, GLProfile glp) {
final int r;
final int ctp = getAvailableContextProperties(device, glp);
- if(0 == ctp) {
+ if(0 == ctp) {
r = -1;
} else if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctp ) ) {
r = 1;
@@ -1732,7 +1732,7 @@ public abstract class GLContext {
}
return r;
}
-
+
/**
* @param device the device to request whether the profile is available for
* @param reqMajor Key Value either 1, 2, 3 or 4
@@ -1774,7 +1774,7 @@ public abstract class GLContext {
int minor[] = { 0 };
int ctp[] = { 0 };
boolean ok;
-
+
ok = GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_ES, major, minor, ctp);
if( !ok ) {
ok = GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_CORE, major, minor, ctp);
@@ -1784,7 +1784,7 @@ public abstract class GLContext {
}
return 0 != ( ctp[0] & CTX_IMPL_ES3_COMPAT );
}
-
+
public static boolean isGL4bcAvailable(AbstractGraphicsDevice device, boolean isHardware[]) {
return isGLVersionAvailable(device, 4, CTX_PROFILE_COMPAT, isHardware);
}
@@ -1859,6 +1859,6 @@ public abstract class GLContext {
}
protected static String getThreadName() { return Thread.currentThread().getName(); }
-
+
}
diff --git a/src/jogl/classes/javax/media/opengl/GLDebugListener.java b/src/jogl/classes/javax/media/opengl/GLDebugListener.java
index 8887d022a..ec7f7cec1 100644
--- a/src/jogl/classes/javax/media/opengl/GLDebugListener.java
+++ b/src/jogl/classes/javax/media/opengl/GLDebugListener.java
@@ -29,16 +29,16 @@ package javax.media.opengl;
/**
* Listener for {@link GLDebugMessage}s.
- *
+ *
*
One can enable GLDebugOutput via {@link GLContext#enableGLDebugMessage(boolean)}
* and add listeners via {@link GLContext#addGLDebugListener(GLDebugListener)}.
*/
public interface GLDebugListener {
- /**
+ /**
* Handle {@link GLDebugMessage} message sent from native GL implementation.
- *
+ *
*
Since this method is invoked directly by the GL implementation, it shall
* return as fast as possible.
*/
- void messageSent(GLDebugMessage event);
+ void messageSent(GLDebugMessage event);
}
diff --git a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
index 4b8d62898..1032cf929 100644
--- a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
+++ b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
@@ -30,18 +30,18 @@ package javax.media.opengl;
import com.jogamp.common.os.Platform;
/**
- * OpenGL debug message generated by the driver
+ * OpenGL debug message generated by the driver
* and delivered via {@link GLDebugListener}.
*/
public class GLDebugMessage {
final GLContext source;
- final long when;
+ final long when;
final int dbgSource;
final int dbgType;
final int dbgId;
final int dbgSeverity;
final String dbgMsg;
-
+
/**
* @param source The source of the event
* @param when The time of the event
@@ -60,9 +60,9 @@ public class GLDebugMessage {
this.dbgSeverity = dbgSeverity;
this.dbgMsg = dbgMsg;
}
-
+
/**
- *
+ *
* @param source
* @param when
* @param dbgId
@@ -73,88 +73,88 @@ public class GLDebugMessage {
*/
public static GLDebugMessage translateAMDEvent(GLContext source, long when, int dbgId, int amdDbgCategory, int dbgSeverity, String dbgMsg) {
int dbgSource, dbgType;
-
+
// AMD category == ARB source/type
switch(amdDbgCategory) {
- case GL2GL3.GL_DEBUG_CATEGORY_API_ERROR_AMD:
+ case GL2GL3.GL_DEBUG_CATEGORY_API_ERROR_AMD:
dbgSource = GL2GL3.GL_DEBUG_SOURCE_API;
- dbgType = GL2GL3.GL_DEBUG_TYPE_ERROR;
+ dbgType = GL2GL3.GL_DEBUG_TYPE_ERROR;
break;
//
// def source / other type
//
-
- case GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD:
+
+ case GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD:
dbgSource = GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM;
- dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+ dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
break;
-
+
case GL2GL3.GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD:
dbgSource = GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+ dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
break;
-
+
case GL2GL3.GL_DEBUG_CATEGORY_APPLICATION_AMD:
dbgSource = GL2GL3.GL_DEBUG_SOURCE_APPLICATION;
dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
break;
-
-
+
+
//
// other source / def type
//
-
+
case GL2GL3.GL_DEBUG_CATEGORY_DEPRECATION_AMD:
dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
+ dbgType = GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
break;
-
+
case GL2GL3.GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD:
dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
+ dbgType = GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
break;
-
+
case GL2GL3.GL_DEBUG_CATEGORY_PERFORMANCE_AMD:
dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_PERFORMANCE;
+ dbgType = GL2GL3.GL_DEBUG_TYPE_PERFORMANCE;
break;
-
- case GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD:
+
+ case GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD:
default:
dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
}
-
- return new GLDebugMessage(source, when, dbgSource, dbgType, dbgId, dbgSeverity, dbgMsg);
+
+ return new GLDebugMessage(source, when, dbgSource, dbgType, dbgId, dbgSeverity, dbgMsg);
}
public static int translateARB2AMDCategory(int dbgSource, int dbgType) {
switch (dbgSource) {
case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM:
- return GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD;
-
+ return GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD;
+
case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER:
return GL2GL3.GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD;
-
+
case GL2GL3.GL_DEBUG_SOURCE_APPLICATION:
return GL2GL3.GL_DEBUG_CATEGORY_APPLICATION_AMD;
}
-
+
switch(dbgType) {
case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
return GL2GL3.GL_DEBUG_CATEGORY_DEPRECATION_AMD;
-
+
case GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
return GL2GL3.GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD;
-
- case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE:
+
+ case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE:
return GL2GL3.GL_DEBUG_CATEGORY_PERFORMANCE_AMD;
}
-
- return GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD;
+
+ return GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD;
}
-
+
public GLContext getSource() {
return source;
}
@@ -162,7 +162,7 @@ public class GLDebugMessage {
public long getWhen() {
return when;
}
-
+
public int getDbgSource() {
return dbgSource;
}
@@ -182,14 +182,14 @@ public class GLDebugMessage {
public String getDbgMsg() {
return dbgMsg;
}
-
+
public StringBuilder toString(StringBuilder sb) {
- final String crtab = Platform.getNewline()+"\t";
+ final String crtab = Platform.getNewline()+"\t";
if(null==sb) {
sb = new StringBuilder();
- }
+ }
sb.append("GLDebugEvent[ id ");
- toHexString(sb, dbgId)
+ toHexString(sb, dbgId)
.append(crtab).append("type ").append(getDbgTypeString(dbgType))
.append(crtab).append("severity ").append(getDbgSeverityString(dbgSeverity))
.append(crtab).append("source ").append(getDbgSourceString(dbgSource))
@@ -199,46 +199,46 @@ public class GLDebugMessage {
sb.append(crtab).append("source ").append(source.getGLVersion()).append(" - hash 0x").append(Integer.toHexString(source.hashCode()));
}
sb.append("]");
- return sb;
+ return sb;
}
public String toString() {
return toString(null).toString();
}
-
+
public static String getDbgSourceString(int dbgSource) {
switch(dbgSource) {
case GL2GL3.GL_DEBUG_SOURCE_API: return "GL API";
- case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER: return "GLSL or extension compiler";
- case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "Native Windowing binding";
+ case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER: return "GLSL or extension compiler";
+ case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "Native Windowing binding";
case GL2GL3.GL_DEBUG_SOURCE_THIRD_PARTY: return "Third party";
case GL2GL3.GL_DEBUG_SOURCE_APPLICATION: return "Application";
case GL2GL3.GL_DEBUG_SOURCE_OTHER: return "generic";
default: return "Unknown (" + toHexString(dbgSource) + ")";
}
}
-
+
public static String getDbgTypeString(int dbgType) {
switch(dbgType) {
case GL2GL3.GL_DEBUG_TYPE_ERROR: return "Error";
- case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "Warning: marked for deprecation";
+ case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "Warning: marked for deprecation";
case GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: return "Warning: undefined behavior";
- case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE: return "Warning: implementation dependent performance";
- case GL2GL3.GL_DEBUG_TYPE_PORTABILITY: return "Warning: vendor-specific extension use";
- case GL2GL3.GL_DEBUG_TYPE_OTHER: return "Warning: generic";
+ case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE: return "Warning: implementation dependent performance";
+ case GL2GL3.GL_DEBUG_TYPE_PORTABILITY: return "Warning: vendor-specific extension use";
+ case GL2GL3.GL_DEBUG_TYPE_OTHER: return "Warning: generic";
default: return "Unknown (" + toHexString(dbgType) + ")";
}
}
-
+
public static String getDbgSeverityString(int dbgSeverity) {
switch(dbgSeverity) {
- case GL2GL3.GL_DEBUG_SEVERITY_HIGH: return "High: dangerous undefined behavior";
- case GL2GL3.GL_DEBUG_SEVERITY_MEDIUM: return "Medium: Severe performance/deprecation/other warnings";
- case GL2GL3.GL_DEBUG_SEVERITY_LOW: return "Low: Performance warnings (redundancy/undefined)";
+ case GL2GL3.GL_DEBUG_SEVERITY_HIGH: return "High: dangerous undefined behavior";
+ case GL2GL3.GL_DEBUG_SEVERITY_MEDIUM: return "Medium: Severe performance/deprecation/other warnings";
+ case GL2GL3.GL_DEBUG_SEVERITY_LOW: return "Low: Performance warnings (redundancy/undefined)";
default: return "Unknown (" + toHexString(dbgSeverity) + ")";
}
}
-
+
public static StringBuilder toHexString(StringBuilder sb, int i) {
if(null==sb) {
sb = new StringBuilder();
@@ -247,6 +247,6 @@ public class GLDebugMessage {
}
public static String toHexString(int i) {
return "0x"+Integer.toHexString(i);
- }
-
+ }
+
}
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawable.java b/src/jogl/classes/javax/media/opengl/GLDrawable.java
index 46fa923ad..5a032db29 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawable.java
@@ -73,13 +73,13 @@ public interface GLDrawable {
*
*
* End users do not need to call this method; it is not necessary to
- * call setRealized on a {@link GLAutoDrawable}
+ * call setRealized on a {@link GLAutoDrawable}
* as these perform the appropriate calls on their underlying GLDrawables internally.
*
*
* Developers implementing new OpenGL components for various window
* toolkits need to call this method against GLDrawables obtained
- * from the GLDrawableFactory via the
+ * from the GLDrawableFactory via the
* {@link GLDrawableFactory#createGLDrawable(NativeSurface)} method.
* It must typically be
* called with an argument of true when the component
@@ -89,7 +89,7 @@ public interface GLDrawable {
* the addNotify method and with an argument of
* false in the removeNotify method.
*
- *
+ *
* GLDrawable implementations should handle multiple
* cycles of setRealized(true) /
* setRealized(false) calls. Most, if not all, Java
@@ -104,7 +104,7 @@ public interface GLDrawable {
* associated resources as the component becomes realized and
* unrealized, respectively.
*
- *
+ *
* With an argument of true,
* the minimum implementation shall call
* {@link NativeSurface#lockSurface() NativeSurface's lockSurface()} and if successful:
@@ -117,7 +117,7 @@ public interface GLDrawable {
* ensures resolving the window/surface handles, and the drawable's {@link GLCapabilities}
* might have changed.
*
- *
+ *
* Calling this method has no other effects. For example, if
* removeNotify is called on a Canvas implementation
* for which a GLDrawable has been created, it is also necessary to
@@ -130,7 +130,7 @@ public interface GLDrawable {
*/
public void setRealized(boolean realized);
- /**
+ /**
* Returns true if this drawable is realized, otherwise true.
*
* A drawable can be realized and unrealized via {@link #setRealized(boolean)}.
@@ -146,19 +146,19 @@ public interface GLDrawable {
public int getHeight();
/**
- * Returns true if the drawable is rendered in
+ * Returns true if the drawable is rendered in
* OpenGL's coordinate system, origin at bottom left.
* Otherwise returns false, i.e. origin at top left.
*
* Default impl. is true, i.e. OpenGL coordinate system.
- *
+ *
*
* Currently only MS-Windows bitmap offscreen drawable uses a non OpenGL orientation and hence returns false.
* This removes the need of a vertical flip when used in AWT or Windows applications.
*
*/
public boolean isGLOriented();
-
+
/** Swaps the front and back buffers of this drawable. For {@link
GLAutoDrawable} implementations, when automatic buffer swapping
is enabled (as is the default), this method is called
@@ -191,11 +191,11 @@ public interface GLDrawable {
public NativeSurface getNativeSurface();
/**
- * Returns the GL drawable handle,
+ * Returns the GL drawable handle,
* guaranteed to be valid after {@link #setRealized(boolean) realization}
* and while it's {@link NativeSurface surface} is being {@link NativeSurface#lockSurface() locked}.
*
- * It is usually identical to the underlying windowing toolkit {@link NativeSurface surface}'s
+ * It is usually identical to the underlying windowing toolkit {@link NativeSurface surface}'s
* {@link javax.media.nativewindow.NativeSurface#getSurfaceHandle() handle}
* or an intermediate layer to suite GL, e.g. an EGL surface.
*
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 7c3c42e45..e486e2bfd 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.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.
*/
@@ -83,7 +83,7 @@ import jogamp.opengl.Debug;
during the first repaint of the {@link javax.media.opengl.awt.GLCanvas} or {@link
javax.media.opengl.awt.GLJPanel} if the capabilities can not be met.
{@link javax.media.opengl.GLPbuffer} are always
- created immediately and their creation will fail with a
+ created immediately and their creation will fail with a
{@link javax.media.opengl.GLException} if errors occur.
The concrete GLDrawableFactory subclass instantiated by {@link
@@ -94,21 +94,21 @@ import jogamp.opengl.Debug;
public abstract class GLDrawableFactory {
protected static final boolean DEBUG = Debug.debug("GLDrawable");
-
- /**
- * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome.
+
+ /**
+ * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome.
* When run in the mentioned browsers, the eglInitialize(..) implementation crashes.
*
* This can be overridden by explicitly enabling ANGLE on Windows by setting the property
* jogl.enable.ANGLE.
- *
+ *
*/
protected static final boolean enableANGLE = Debug.isPropertyDefined("jogl.enable.ANGLE", true);
- /**
+ /**
* In case no OpenGL ES implementation is required
* and if the running platform may have a buggy implementation,
- * setting the property jogl.disable.opengles disables querying a possible existing OpenGL ES implementation.
+ * setting the property jogl.disable.opengles disables querying a possible existing OpenGL ES implementation.
*/
protected static final boolean disableOpenGLES = Debug.isPropertyDefined("jogl.disable.opengles", true);
@@ -117,11 +117,11 @@ public abstract class GLDrawableFactory {
private static GLDrawableFactory nativeOSFactory;
private static ArrayList glDrawableFactories = new ArrayList();
-
+
/**
* Instantiate singleton factories if available, EGLES1, EGLES2 and the OS native ones.
*/
- public static final void initSingleton() {
+ public static final void initSingleton() {
if (!isInit) { // volatile: ok
synchronized (GLDrawableFactory.class) {
if (!isInit) {
@@ -130,7 +130,7 @@ public abstract class GLDrawableFactory {
}
}
}
- }
+ }
private static final void initSingletonImpl() {
NativeWindowFactory.initSingleton();
NativeWindowFactory.addCustomShutdownHook(false /* head */, new Runnable() {
@@ -138,7 +138,7 @@ public abstract class GLDrawableFactory {
shutdown0();
}
});
-
+
final String nwt = NativeWindowFactory.getNativeWindowType(true);
GLDrawableFactory tmp = null;
String factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true);
@@ -163,7 +163,7 @@ public abstract class GLDrawableFactory {
}
try {
tmp = (GLDrawableFactory) ReflectionUtil.createInstance(factoryClassName, cl);
- } catch (Exception jre) {
+ } catch (Exception jre) {
if (DEBUG || GLProfile.DEBUG) {
System.err.println("Info: GLDrawableFactory.static - Native Platform: "+nwt+" - not available: "+factoryClassName);
jre.printStackTrace();
@@ -202,7 +202,7 @@ public abstract class GLDrawableFactory {
}
}
}
-
+
private static void shutdown0() {
// Following code will _always_ remain in shutdown hook
// due to special semantics of native utils, i.e. X11Utils.
@@ -228,22 +228,22 @@ public abstract class GLDrawableFactory {
}
}
glDrawableFactories.clear();
-
- // both were members of glDrawableFactories and are shutdown already
+
+ // both were members of glDrawableFactories and are shutdown already
nativeOSFactory = null;
eglFactory = null;
}
GLContext.shutdown();
}
-
+
protected GLDrawableFactory() {
synchronized(glDrawableFactories) {
glDrawableFactories.add(this);
}
}
-
+
protected static String getThreadName() { return Thread.currentThread().getName(); }
-
+
/** Returns true if this factory is complete, i.e. ready to be used. Otherwise return false. */
protected abstract boolean isComplete();
@@ -253,14 +253,14 @@ public abstract class GLDrawableFactory {
protected abstract void destroy();
public abstract void resetDisplayGamma();
-
+
/**
* Retrieve the default device {@link AbstractGraphicsDevice#getConnection() connection},
* {@link AbstractGraphicsDevice#getUnitID() unit ID} and {@link AbstractGraphicsDevice#getUniqueID() unique ID name}. for this factory
* The implementation must return a non null default device, which must not be opened, ie. it's native handle is null.
*
* This method shall return the default device if available
- * even if the GLDrawableFactory is not functional and hence not compatible.
+ * even if the GLDrawableFactory is not functional and hence not compatible.
* The latter situation may happen because no native OpenGL implementation is available for the specific implementation.
*
* @return the default shared device for this factory, eg. :0.0 on X11 desktop.
@@ -272,7 +272,7 @@ public abstract class GLDrawableFactory {
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device.
* @return true if the device is compatible with this factory, ie. if it can be used for GLDrawable creation. Otherwise false.
* This implies validation whether the implementation is functional.
- *
+ *
* @see #getDefaultDevice()
*/
public abstract boolean getIsDeviceCompatible(AbstractGraphicsDevice device);
@@ -287,8 +287,8 @@ public abstract class GLDrawableFactory {
System.err.println("Info: "+getClass().getSimpleName()+".validateDevice: using default device : "+device);
}
}
-
- // Always validate the device,
+
+ // Always validate the device,
// since even the default device may not be used by this factory.
if( !getIsDeviceCompatible(device) ) {
if (GLProfile.DEBUG) {
@@ -300,29 +300,29 @@ public abstract class GLDrawableFactory {
}
/**
- * Validate and start the shared resource runner thread if necessary and
+ * Validate and start the shared resource runner thread if necessary and
* if the implementation uses it.
- *
+ *
* @return the shared resource runner thread, if implementation uses it.
*/
protected abstract Thread getSharedResourceThread();
-
+
/**
* Create the shared resource used internally as a reference for capabilities etc.
*
- * Returns true if a shared resource could be created
+ * Returns true if a shared resource could be created
* for the device {@link AbstractGraphicsDevice#getConnection()}.
* This does not imply a shared resource is mapped (ie. made persistent), but is available in general .
*
*
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device.
- * @return true if a shared resource could been created, otherwise false.
+ * @return true if a shared resource could been created, otherwise false.
*/
protected final boolean createSharedResource(AbstractGraphicsDevice device) {
return createSharedResourceImpl(device);
- }
+ }
protected abstract boolean createSharedResourceImpl(AbstractGraphicsDevice device);
-
+
/**
* Returns true if the quirk exist in the shared resource's context {@link GLRendererQuirks}.
*
@@ -332,7 +332,7 @@ public abstract class GLDrawableFactory {
return null != glrq ? glrq.exist(quirk) : false;
*
*
- *
+ *
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device.
* @param quirk the quirk to be tested, e.g. {@link GLRendererQuirks#NoDoubleBufferedPBuffer}.
* @throws IllegalArgumentException if the quirk is out of range
@@ -343,7 +343,7 @@ public abstract class GLDrawableFactory {
final GLRendererQuirks glrq = getRendererQuirks(device);
return null != glrq ? glrq.exist(quirk) : false;
}
-
+
/**
* Returns the shared resource's context {@link GLRendererQuirks}.
*
@@ -358,12 +358,12 @@ public abstract class GLDrawableFactory {
* @see GLRendererQuirks
*/
public abstract GLRendererQuirks getRendererQuirks(AbstractGraphicsDevice device);
-
+
/**
* Returns the sole GLDrawableFactory instance for the desktop (X11, WGL, ..) if exist or null
*/
public static GLDrawableFactory getDesktopFactory() {
- GLProfile.initSingleton();
+ GLProfile.initSingleton();
return nativeOSFactory;
}
@@ -371,14 +371,14 @@ public abstract class GLDrawableFactory {
* Returns the sole GLDrawableFactory instance for EGL if exist or null
*/
public static GLDrawableFactory getEGLFactory() {
- GLProfile.initSingleton();
+ GLProfile.initSingleton();
return eglFactory;
}
- /**
- * Returns the sole GLDrawableFactory instance.
- *
- * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
+ /**
+ * Returns the sole GLDrawableFactory instance.
+ *
+ * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
* or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
*/
public static GLDrawableFactory getFactory(GLProfile glProfile) throws GLException {
@@ -387,7 +387,7 @@ public abstract class GLDrawableFactory {
protected static GLDrawableFactory getFactoryImpl(String glProfileImplName) throws GLException {
if ( GLProfile.usesNativeGLES(glProfileImplName) ) {
- if(null!=eglFactory) {
+ if(null!=eglFactory) {
return eglFactory;
}
} else if(null!=nativeOSFactory) {
@@ -446,10 +446,10 @@ public abstract class GLDrawableFactory {
* and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true.
*
*
- * If not onscreen and neither FBO nor Pbuffer is available,
+ * If not onscreen and neither FBO nor Pbuffer is available,
* a simple pixmap/bitmap drawable/surface is created, which is unlikely to be hardware accelerated.
*
- *
+ *
* @throws IllegalArgumentException if the passed target is null
* @throws GLException if any window system-specific errors caused
* the creation of the GLDrawable to fail.
@@ -463,12 +463,12 @@ public abstract class GLDrawableFactory {
*/
public abstract GLDrawable createGLDrawable(NativeSurface target)
throws IllegalArgumentException, GLException;
-
+
/**
- * Creates a {@link GLDrawable#isRealized() realized} {@link GLOffscreenAutoDrawable}
+ * Creates a {@link GLDrawable#isRealized() realized} {@link GLOffscreenAutoDrawable}
* incl it's offscreen {@link javax.media.nativewindow.NativeSurface} with the given capabilites and dimensions.
*
- * The {@link GLOffscreenAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized}
+ * The {@link GLOffscreenAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized}
* and it's {@link GLContext} assigned but not yet made current.
*
*
@@ -485,7 +485,7 @@ public abstract class GLDrawableFactory {
* and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true.
*
*
- * If neither FBO nor Pbuffer is available,
+ * If neither FBO nor Pbuffer is available,
* a simple pixmap/bitmap auto drawable is created, which is unlikely to be hardware accelerated.
*
*
@@ -498,7 +498,7 @@ public abstract class GLDrawableFactory {
*
* @throws GLException if any window system-specific errors caused
* the creation of the Offscreen to fail.
- *
+ *
* @see #createOffscreenDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int)
*/
public abstract GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice device,
@@ -507,7 +507,7 @@ public abstract class GLDrawableFactory {
int width, int height,
GLContext shareWith) throws GLException;
/**
- * Creates an {@link GLDrawable#isRealized() unrealized} offscreen {@link GLDrawable}
+ * Creates an {@link GLDrawable#isRealized() unrealized} offscreen {@link GLDrawable}
* incl it's offscreen {@link javax.media.nativewindow.NativeSurface} with the given capabilites and dimensions.
*
* In case the passed {@link GLCapabilitiesImmutable} contains default values, i.e.
@@ -523,7 +523,7 @@ public abstract class GLDrawableFactory {
* and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true.
*
*
- * If neither FBO nor Pbuffer is available,
+ * If neither FBO nor Pbuffer is available,
* a simple pixmap/bitmap drawable is created, which is unlikely to be hardware accelerated.
*
*
@@ -537,7 +537,7 @@ public abstract class GLDrawableFactory {
*
* @throws GLException if any window system-specific errors caused
* the creation of the Offscreen to fail.
- *
+ *
* @see #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext)
*/
public abstract GLDrawable createOffscreenDrawable(AbstractGraphicsDevice device,
@@ -546,7 +546,7 @@ public abstract class GLDrawableFactory {
int width, int height) throws GLException;
/**
- * Creates an {@link GLDrawable#isRealized() unrealized} dummy {@link GLDrawable}.
+ * Creates an {@link GLDrawable#isRealized() unrealized} dummy {@link GLDrawable}.
* A dummy drawable is not visible on screen and will not be used to render directly to, it maybe on- or offscreen.
*
* It is used to allow the creation of a {@link GLContext} to query information.
@@ -558,26 +558,26 @@ public abstract class GLDrawableFactory {
* @return the created dummy {@link GLDrawable}
*/
public abstract GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp);
-
+
/**
- * Creates a proxy {@link NativeSurface} w/ defined surface handle,
- * i.e. a {@link jogamp.nativewindow.WrappedSurface} or {@link jogamp.nativewindow.windows.GDISurface} instance.
+ * Creates a proxy {@link NativeSurface} w/ defined surface handle,
+ * i.e. a {@link jogamp.nativewindow.WrappedSurface} or {@link jogamp.nativewindow.windows.GDISurface} instance.
*
- * It's {@link AbstractGraphicsConfiguration} is properly set according to the given
+ * It's {@link AbstractGraphicsConfiguration} is properly set according to the given
* windowHandle's native visualID if set or the given {@link GLCapabilitiesImmutable}.
*
*
* Lifecycle (creation and destruction) of the given surface handle shall be handled by the caller
- * via {@link ProxySurface#createNotify()} and {@link ProxySurface#destroyNotify()}.
+ * via {@link ProxySurface#createNotify()} and {@link ProxySurface#destroyNotify()}.
*
*
* Such surface can be used to instantiate a GLDrawable. With the help of {@link GLAutoDrawableDelegate}
- * you will be able to implement a new native windowing system binding almost on-the-fly,
- * see {@link com.jogamp.opengl.swt.GLCanvas}.
+ * you will be able to implement a new native windowing system binding almost on-the-fly,
+ * see {@link com.jogamp.opengl.swt.GLCanvas}.
*
- *
+ *
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device.
- * Caller has to ensure it is compatible w/ the given windowHandle
+ * Caller has to ensure it is compatible w/ the given windowHandle
* @param screenIdx matching screen index of given windowHandle
* @param windowHandle the native window handle
* @param caps the requested GLCapabilties
@@ -586,15 +586,15 @@ public abstract class GLDrawableFactory {
* @return the created {@link ProxySurface} instance w/ defined surface handle.
*/
public abstract ProxySurface createProxySurface(AbstractGraphicsDevice device,
- int screenIdx,
- long windowHandle,
+ int screenIdx,
+ long windowHandle,
GLCapabilitiesImmutable caps, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream);
-
+
/**
* Returns true if it is possible to create an framebuffer object (FBO).
*
* FBO feature is implemented in OpenGL, hence it is {@link GLProfile} dependent.
- *
+ *
*
* FBO support is queried as described in {@link GLContext#hasBasicFBOSupport()}.
*
@@ -607,9 +607,9 @@ public abstract class GLDrawableFactory {
/**
* Returns true if it is possible to create an pbuffer surface.
- *
- * Some older graphics cards do not have this capability,
- * as well as some new GL implementation, i.e. OpenGL 3 core on OSX.
+ *
+ * Some older graphics cards do not have this capability,
+ * as well as some new GL implementation, i.e. OpenGL 3 core on OSX.
*
*
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device.
@@ -637,7 +637,7 @@ public abstract class GLDrawableFactory {
*
* @throws GLException if any window system-specific errors caused
* the creation of the GLPbuffer to fail.
- *
+ *
* @deprecated {@link GLPbuffer} is deprecated, use {@link #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext)}
*/
public abstract GLPbuffer createGLPbuffer(AbstractGraphicsDevice device,
@@ -648,7 +648,7 @@ public abstract class GLDrawableFactory {
GLContext shareWith)
throws GLException;
-
+
//----------------------------------------------------------------------
// Methods for interacting with third-party OpenGL libraries
diff --git a/src/jogl/classes/javax/media/opengl/GLEventListener.java b/src/jogl/classes/javax/media/opengl/GLEventListener.java
index 15fae4a39..c8c3440b5 100644
--- a/src/jogl/classes/javax/media/opengl/GLEventListener.java
+++ b/src/jogl/classes/javax/media/opengl/GLEventListener.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
@@ -49,7 +49,7 @@ import java.util.EventListener;
public interface GLEventListener extends EventListener {
/** Called by the drawable immediately after the OpenGL context is
initialized. Can be used to perform one-time OpenGL
- initialization per GLContext, such as setup of lights and display lists.
+ initialization per GLContext, such as setup of lights and display lists.
Note that this method may be called more than once if the underlying
OpenGL context for the GLAutoDrawable is destroyed and
@@ -57,7 +57,7 @@ public interface GLEventListener extends EventListener {
hierarchy and later added again.
*/
public void init(GLAutoDrawable drawable);
-
+
/** Notifies the listener to perform the release of all OpenGL
resources per GLContext, such as memory buffers and GLSL programs.
@@ -68,11 +68,11 @@ public interface GLEventListener extends EventListener {
Note that this event does not imply the end of life of the application.
It could be produced with a followup call to {@link #init(GLAutoDrawable)}
- in case the GLContext has been recreated,
+ in case the GLContext has been recreated,
e.g. due to a pixel configuration change in a multihead environment.
*/
public void dispose(GLAutoDrawable drawable);
-
+
/** Called by the drawable to initiate OpenGL rendering by the
client. After all GLEventListeners have been notified of a
display event, the drawable will swap its buffers if {@link
diff --git a/src/jogl/classes/javax/media/opengl/GLException.java b/src/jogl/classes/javax/media/opengl/GLException.java
index 644042e15..460f17be9 100644
--- a/src/jogl/classes/javax/media/opengl/GLException.java
+++ b/src/jogl/classes/javax/media/opengl/GLException.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
index df38745d5..052b08a4b 100644
--- a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLFBODrawable.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.
@@ -33,17 +33,17 @@ import javax.media.nativewindow.NativeWindowException;
import com.jogamp.opengl.FBObject;
import com.jogamp.opengl.FBObject.TextureAttachment;
-/**
+/**
* Platform-independent {@link GLDrawable} specialization,
* exposing {@link FBObject} functionality.
*
*
- * A {@link GLFBODrawable} is uninitialized until a {@link GLContext} is bound
+ * A {@link GLFBODrawable} is uninitialized until a {@link GLContext} is bound
* and made current the first time, hence only then it's capabilities fully reflect expectations,
* i.e. color, depth, stencil and MSAA bits will be valid only after the first {@link GLContext#makeCurrent() makeCurrent()} call.
* On-/offscreen bits are valid after {@link #setRealized(boolean) setRealized(true)}.
*
- *
+ *
*
* MSAA is used if {@link GLCapabilitiesImmutable#getNumSamples() requested}.
*
@@ -51,7 +51,7 @@ import com.jogamp.opengl.FBObject.TextureAttachment;
* Double buffering is used if {@link GLCapabilitiesImmutable#getDoubleBuffered() requested}.
*
*
- * In MSAA mode, it always uses the implicit 2nd {@link FBObject framebuffer} {@link FBObject#getSamplingSinkFBO() sink}.
+ * In MSAA mode, it always uses the implicit 2nd {@link FBObject framebuffer} {@link FBObject#getSamplingSinkFBO() sink}.
* Hence double buffering is always the case w/ MSAA.
*
*
@@ -61,7 +61,7 @@ import com.jogamp.opengl.FBObject.TextureAttachment;
* This method also allows usage of both textures seperately.
*
*
- * It would be possible to implement double buffering simply using
+ * It would be possible to implement double buffering simply using
* {@link TextureAttachment}s with one {@link FBObject framebuffer}.
* This would require mode selection and hence complicate the API. Besides, it would
* not support differentiation of read and write framebuffer and hence not be spec compliant.
@@ -71,50 +71,50 @@ import com.jogamp.opengl.FBObject.TextureAttachment;
* is performed either in the {@link jogamp.opengl.GLContextImpl#contextMadeCurrent(boolean) context current hook}
* or when {@link jogamp.opengl.GLDrawableImpl#swapBuffersImpl(boolean) swapping buffers}, whatever comes first.
*
- */
+ */
public interface GLFBODrawable extends GLDrawable {
// public enum DoubleBufferMode { NONE, TEXTURE, FBO }; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
-
+
/**
* @return true if initialized, i.e. a {@link GLContext} is bound and made current once, otherwise false.
*/
public boolean isInitialized();
-
+
/**
* Notify this instance about upstream size change
* to reconfigure the {@link FBObject}.
- * @param gl GL context object bound to this drawable, will be made current during operation.
- * A prev. current context will be make current after operation.
+ * @param gl GL context object bound to this drawable, will be made current during operation.
+ * A prev. current context will be make current after operation.
* @throws GLException if resize operation failed
*/
void resetSize(GL gl) throws GLException;
-
+
/**
* @return the used texture unit
*/
int getTextureUnit();
-
+
/**
- *
+ *
* @param unit the texture unit to be used
*/
void setTextureUnit(int unit);
-
+
/**
* Set the number of sample buffers if using MSAA
- *
- * @param gl GL context object bound to this drawable, will be made current during operation.
- * A prev. current context will be make current after operation.
+ *
+ * @param gl GL context object bound to this drawable, will be made current during operation.
+ * A prev. current context will be make current after operation.
* @param newSamples new sample size
* @throws GLException if resetting the FBO failed
*/
void setNumSamples(GL gl, int newSamples) throws GLException;
-
+
/**
* @return the number of sample buffers if using MSAA, otherwise 0
*/
int getNumSamples();
-
+
/**
* Sets the number of buffers (FBO) being used if using {@link GLCapabilities#getDoubleBuffered() double buffering}.
*
* Must be called before {@link #isInitialized() initialization}, otherwise an exception is thrown.
*
- * @return the new number of buffers (FBO) used, maybe different than the requested bufferCount (see above)
+ * @return the new number of buffers (FBO) used, maybe different than the requested bufferCount (see above)
* @throws GLException if already initialized, see {@link #isInitialized()}.
*/
int setNumBuffers(int bufferCount) throws GLException;
-
- /**
+
+ /**
* @return the number of buffers (FBO) being used. 1 if not using {@link GLCapabilities#getDoubleBuffered() double buffering},
- * otherwise ≥ 2, depending on {@link #setNumBuffers(int)}.
+ * otherwise ≥ 2, depending on {@link #setNumBuffers(int)}.
*/
int getNumBuffers();
-
+
/**
- * @return the used {@link DoubleBufferMode}
+ * @return the used {@link DoubleBufferMode}
*/
// DoubleBufferMode getDoubleBufferMode(); // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
-
+
/**
* Sets the {@link DoubleBufferMode}. Must be called before {@link #isInitialized() initialization},
* otherwise an exception is thrown.
@@ -153,11 +153,11 @@ public interface GLFBODrawable extends GLDrawable {
* @throws GLException if already initialized, see {@link #isInitialized()}.
*/
// void setDoubleBufferMode(DoubleBufferMode mode) throws GLException; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
-
+
/**
* If MSAA is being used and {@link GL#GL_FRONT} is requested,
- * the internal {@link FBObject} {@link FBObject#getSamplingSinkFBO() sample sink} is being returned.
- *
+ * the internal {@link FBObject} {@link FBObject#getSamplingSinkFBO() sample sink} is being returned.
+ *
* @param bufferName {@link GL#GL_FRONT} and {@link GL#GL_BACK} are valid buffer names
* @return the named {@link FBObject}
* @throws IllegalArgumentException if an illegal buffer name is being used
@@ -167,7 +167,7 @@ public interface GLFBODrawable extends GLDrawable {
/**
* Returns the named texture buffer.
*
- * If MSAA is being used, only the {@link GL#GL_FRONT} buffer is accessible
+ * If MSAA is being used, only the {@link GL#GL_FRONT} buffer is accessible
* and an exception is being thrown if {@link GL#GL_BACK} is being requested.
*
* This drawable is being locked during operation.
*
- * @param context the {@link GLContext} bound to this drawable, will be made current during operation
- * A prev. current context will be make current after operation.
+ * @param context the {@link GLContext} bound to this drawable, will be made current during operation
+ * A prev. current context will be make current after operation.
* @param newWidth
* @param newHeight
* @throws NativeWindowException in case the surface could no be locked
* @throws GLException in case an error during the resize operation occurred
*/
- void setSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException;
+ void setSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException;
}
}
diff --git a/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java
index 6fe76a3f4..be90d935f 100644
--- a/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.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.
@@ -32,7 +32,7 @@ import javax.media.nativewindow.NativeWindowException;
import com.jogamp.opengl.FBObject;
-/**
+/**
* Platform-independent {@link GLAutoDrawable} specialization,
* exposing offscreen functionality.
*
*/
public interface GLOffscreenAutoDrawable extends GLAutoDrawable {
-
+
/**
* Resize this auto drawable.
* @param newWidth
@@ -56,8 +56,8 @@ public interface GLOffscreenAutoDrawable extends GLAutoDrawable {
* @see #getUpstreamWidget()
*/
void setUpstreamWidget(Object newUpstreamWidget);
-
- /** {@link FBObject} based {@link GLOffscreenAutoDrawable} specialization */
- public interface FBO extends GLOffscreenAutoDrawable, GLFBODrawable {
- }
+
+ /** {@link FBObject} based {@link GLOffscreenAutoDrawable} specialization */
+ public interface FBO extends GLOffscreenAutoDrawable, GLFBODrawable {
+ }
}
diff --git a/src/jogl/classes/javax/media/opengl/GLPbuffer.java b/src/jogl/classes/javax/media/opengl/GLPbuffer.java
index 12f57fcd8..f36a4bf29 100644
--- a/src/jogl/classes/javax/media/opengl/GLPbuffer.java
+++ b/src/jogl/classes/javax/media/opengl/GLPbuffer.java
@@ -46,8 +46,8 @@ package javax.media.opengl;
as a texture map and enabling rendering to floating-point frame
buffers. These methods are not guaranteed to be supported on all
platforms and may be deprecated in a future release.
-
- @deprecated Use {@link GLOffscreenAutoDrawable} w/ {@link GLCapabilities#setFBO(boolean)}
+
+ @deprecated Use {@link GLOffscreenAutoDrawable} w/ {@link GLCapabilities#setFBO(boolean)}
via {@link GLDrawableFactory#createOffscreenAutoDrawable(javax.media.nativewindow.AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext) GLDrawableFactory.createOffscreenAutoDrawable(..)}.
*/
public interface GLPbuffer extends GLAutoDrawable {
diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
index c6bf26235..d947bada2 100644
--- a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -28,7 +28,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.
@@ -49,7 +49,7 @@ import jogamp.opengl.*;
public class GLPipelineFactory {
public static final boolean DEBUG = Debug.debug("GLPipelineFactory");
- /**
+ /**
* Creates a pipelined GL instance using the given downstream downstream
* and optional arguments additionalArgs for the constructor.
*
@@ -66,7 +66,7 @@ public class GLPipelineFactory {
* gl = drawable.setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, gl, new Object[] { System.err } ) );
*
*
- *
+ *
*
* The upstream GL instance is determined as follows:
*
@@ -76,7 +76,7 @@ public class GLPipelineFactory {
*
For all downstream class and superclass interfaces, do:
*
*
If reqInterface is not null and the interface is unequal, continue loop.
- *
If downstream is not instance of interface, continue loop.
+ *
If downstream is not instance of interface, continue loop.
*
If upstream class is available use it, end loop.
*
*
@@ -116,7 +116,7 @@ public class GLPipelineFactory {
if(DEBUG) {
System.out.println("GLPipelineFactory: "+downstream.getClass().getName() + " is _not_ instance of "+ clazzes[i].getName());
}
- continue; // not a compatible one
+ continue; // not a compatible one
} else {
if(DEBUG) {
System.out.println("GLPipelineFactory: "+downstream.getClass().getName() + " _is_ instance of "+ clazzes[i].getName());
@@ -153,7 +153,7 @@ public class GLPipelineFactory {
// throws exception if cstr not found!
Constructor> cstr = ReflectionUtil.getConstructor(upstreamClazz, cstrArgTypes);
Object instance = null;
- try {
+ try {
Object[] cstrArgs = new Object[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
{
int i = 0;
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 4a2edc56b..15300e397 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.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.
@@ -66,48 +66,48 @@ import java.util.List;
/**
* Specifies the the OpenGL profile.
- *
+ *
* This class static singleton initialization queries the availability of all OpenGL Profiles
* and instantiates singleton GLProfile objects for each available profile.
*
- * The platform default profile may be used, using {@link GLProfile#GetProfileDefault()},
+ * The platform default profile may be used, using {@link GLProfile#GetProfileDefault()},
* or more specialized versions using the other static GetProfile methods.
*/
public class GLProfile {
-
+
public static final boolean DEBUG = Debug.debug("GLProfile");
-
+
static {
// Also initializes TempJarCache if shall be used.
Platform.initSingleton();
}
-
+
/**
* Static initialization of JOGL.
*
*
* This method shall not need to be called for other reasons than having a defined initialization sequence.
*
- *
+ *
*
* In case this method is not invoked, GLProfile is initialized implicit by
* the first call to {@link #getDefault()}, {@link #get(java.lang.String)}.
*
- *
+ *
*
- * To initialize JOGL at startup ASAP, this method may be invoked in the main class's
+ * To initialize JOGL at startup ASAP, this method may be invoked in the main class's
* static initializer block, in the static main() method or in the Applet init() method.
*
- *
+ *
*
* Since JOGL's initialization is complex and involves multi threading, it is not recommended
- * to be have it invoked on the AWT EDT thread. In case all JOGL usage is performed
+ * to be have it invoked on the AWT EDT thread. In case all JOGL usage is performed
* on the AWT EDT, invoke this method outside the AWT EDT - see above.
*
- *
+ *
*/
public static void initSingleton() {
- final boolean justInitialized;
+ final boolean justInitialized;
initLock.lock();
try {
if(!initialized) { // volatile: ok
@@ -117,13 +117,13 @@ public class GLProfile {
System.err.println("GLProfile.initSingleton() - thread "+Thread.currentThread().getName());
Thread.dumpStack();
}
-
+
// run the whole static initialization privileged to speed up,
// since this skips checking further access
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
Platform.initSingleton();
-
+
// Performance hack to trigger classloading of the GL classes impl, which makes up to 12%, 800ms down to 700ms
new Thread(new Runnable() {
public void run() {
@@ -132,15 +132,15 @@ public class GLProfile {
ReflectionUtil.createInstance(getGLImplBaseClassName(GL4bc)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);
} catch (Throwable t) {}
try {
- ReflectionUtil.createInstance(getGLImplBaseClassName(GLES3)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);
+ ReflectionUtil.createInstance(getGLImplBaseClassName(GLES3)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);
} catch (Throwable t) {}
try {
- ReflectionUtil.createInstance(getGLImplBaseClassName(GLES1)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);
+ ReflectionUtil.createInstance(getGLImplBaseClassName(GLES1)+"Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { null, null }, cl);
} catch (Throwable t) {}
}
- }, "GLProfile-GL_Bootstrapping").start();
+ }, "GLProfile-GL_Bootstrapping").start();
+
-
if(TempJarCache.isInitialized()) {
final ClassLoader cl = GLProfile.class.getClassLoader();
final String newtFactoryClassName = "com.jogamp.newt.NewtFactory";
@@ -164,13 +164,13 @@ public class GLProfile {
if( justInitialized && ( hasGL234Impl || hasGLES1Impl || hasGLES3Impl ) ) {
System.err.println(JoglVersion.getDefaultOpenGLInfo(defaultDevice, null, true));
}
- }
+ }
}
/**
* Trigger eager initialization of GLProfiles for the given device,
* in case it isn't done yet.
- *
+ *
* @throws GLException if no profile for the given device is available.
*/
public static void initProfiles(AbstractGraphicsDevice device) throws GLException {
@@ -194,7 +194,7 @@ public class GLProfile {
if(DEBUG) {
System.err.println("GLProfile.shutdown() - thread "+Thread.currentThread().getName());
Thread.dumpStack();
- }
+ }
GLDrawableFactory.shutdown();
}
} finally {
@@ -206,11 +206,11 @@ public class GLProfile {
// Query platform available OpenGL implementation
//
- /**
+ /**
* Returns the availability of a profile on a device.
- *
+ *
* @param device a valid AbstractGraphicsDevice, or null for the default device.
- * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
+ * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
* or [ null, GL ] for the default profile.
* @return true if the profile is available for the device, otherwise false.
*/
@@ -221,31 +221,31 @@ public class GLProfile {
private static boolean isAvailableImpl(HashMap map, String profile) {
return null != map && null != map.get(profile);
}
-
- /**
+
+ /**
* Returns the availability of a profile on the default device.
- *
- * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
+ *
+ * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
* or [ null, GL ] for the default profile.
* @return true if the profile is available for the default device, otherwise false.
*/
public static boolean isAvailable(String profile) {
return isAvailable(null, profile);
}
-
- /**
+
+ /**
* Returns the availability of any profile on the default device.
- *
+ *
* @return true if any profile is available for the default device, otherwise false.
*/
public static boolean isAnyAvailable() {
return isAvailable(null, null);
}
-
+
public static String glAvailabilityToString(AbstractGraphicsDevice device) {
return glAvailabilityToString(device, null).toString();
}
-
+
public static StringBuilder glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb) {
return glAvailabilityToString(device, sb, null, 0);
}
@@ -264,19 +264,19 @@ public class GLProfile {
final boolean useIndent = null != indent;
initSingleton();
-
+
if(null==device) {
device = defaultDevice;
}
final HashMap map = getProfileMap(device, false);
-
+
if(useIndent) {
doIndent(sb, indent, indentCount).append("Native");
indentCount++;
doIndent(sb.append(Platform.getNewline()), indent, indentCount).append("GL4bc").append(indent);
} else {
sb.append("Native[GL4bc ");
- }
+ }
avail=isAvailableImpl(map, GL4bc);
sb.append(avail);
if(avail) {
@@ -366,7 +366,7 @@ public class GLProfile {
sb.append(", GL4ES3 ");
}
sb.append(isAvailableImpl(map, GL4ES3));
-
+
if(useIndent) {
doIndent(sb.append(Platform.getNewline()), indent, indentCount).append("GL2ES2").append(indent);
} else {
@@ -388,7 +388,7 @@ public class GLProfile {
} else {
sb.append("], Profiles[");
}
-
+
if(null != map) {
for(Iterator i=map.values().iterator(); i.hasNext(); ) {
if(useIndent) {
@@ -418,7 +418,7 @@ public class GLProfile {
return sb;
}
-
+
/** Uses the default device */
public static String glAvailabilityToString() {
return glAvailabilityToString(null);
@@ -465,11 +465,11 @@ public class GLProfile {
/** The intersection of the desktop GL4 and ES3 profile */
public static final String GL4ES3 = "GL4ES3";
-
+
/** The default profile, used for the device default profile map */
private static final String GL_DEFAULT = "GL_DEFAULT";
- /**
+ /**
* All GL Profiles in the order of default detection.
* Desktop compatibility profiles (the one with fixed function pipeline) comes first
* from highest to lowest version.
@@ -492,7 +492,7 @@ public class GLProfile {
*
*/
public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL4bc, GL3bc, GL2, GL4, GL3, GLES3, GL4ES3, GL2GL3, GLES2, GL2ES2, GLES1, GL2ES1 };
-
+
/**
* Order of maximum profiles.
*
@@ -526,7 +526,7 @@ public class GLProfile {
*
*/
public static final String[] GL_PROFILE_LIST_MIN = new String[] { GLES1, GLES2, GL2, GLES3, GL3, GL3bc, GL4, GL4bc };
-
+
/**
* Order of minimum original desktop profiles.
*
@@ -540,7 +540,7 @@ public class GLProfile {
*
*/
public static final String[] GL_PROFILE_LIST_MIN_DESKTOP = new String[] { GL2, GL3bc, GL4bc, GL3, GL4 };
-
+
/**
* Order of maximum fixed function profiles
*
@@ -582,7 +582,7 @@ public class GLProfile {
*
*/
public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER_CORE = new String[] { GL4, GL3, GLES3, GLES2 };
-
+
/** Returns a default GLProfile object, reflecting the best for the running platform.
* It selects the first of the set {@link GLProfile#GL_PROFILE_LIST_ALL}
* and favors hardware acceleration.
@@ -597,7 +597,7 @@ public class GLProfile {
/** Returns a default GLProfile object, reflecting the best for the running platform.
* It selects the first of the set {@link GLProfile#GL_PROFILE_LIST_ALL}
* and favors hardware acceleration.
- *
Uses the default device.
+ *
Uses the default device.
* @throws GLException if no profile is available for the default device.
*/
public static GLProfile getDefault() {
@@ -617,7 +617,7 @@ public class GLProfile {
return get(device, GL_PROFILE_LIST_MAX, favorHardwareRasterizer);
}
- /** Uses the default device
+ /** Uses the default device
* @throws GLException if no profile is available for the default device.
* @see #GL_PROFILE_LIST_MAX
*/
@@ -640,7 +640,7 @@ public class GLProfile {
return get(device, GL_PROFILE_LIST_MIN, favorHardwareRasterizer);
}
- /** Uses the default device
+ /** Uses the default device
* @throws GLException if no desktop profile is available for the default device.
* @see #GL_PROFILE_LIST_MIN
*/
@@ -664,7 +664,7 @@ public class GLProfile {
return get(device, GL_PROFILE_LIST_MAX_FIXEDFUNC, favorHardwareRasterizer);
}
- /** Uses the default device
+ /** Uses the default device
* @throws GLException if no fixed function profile is available for the default device.
* @see #GL_PROFILE_LIST_MAX_FIXEDFUNC
*/
@@ -687,7 +687,7 @@ public class GLProfile {
return get(device, GL_PROFILE_LIST_MAX_PROGSHADER, favorHardwareRasterizer);
}
- /** Uses the default device
+ /** Uses the default device
* @throws GLException if no programmable profile is available for the default device.
* @see #GL_PROFILE_LIST_MAX_PROGSHADER
*/
@@ -706,11 +706,11 @@ public class GLProfile {
*/
public static GLProfile getMaxProgrammableCore(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
throws GLException
- {
+ {
return get(device, GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer);
}
- /** Uses the default device
+ /** Uses the default device
* @throws GLException if no programmable core profile is available for the default device.
* @see #GL_PROFILE_LIST_MAX_PROGSHADER_CORE
*/
@@ -719,8 +719,8 @@ public class GLProfile {
{
return get(GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer);
}
-
- /**
+
+ /**
* Returns the GL2ES1 profile implementation, hence compatible w/ GL2ES1.
* It returns:
*
@@ -739,8 +739,8 @@ public class GLProfile {
return get(device, GL2ES1).getImpl();
}
- /**
- * Calls {@link #getGL2ES1(AbstractGraphicsDevice)} using the default device.
+ /**
+ * Calls {@link #getGL2ES1(AbstractGraphicsDevice)} using the default device.
*
Selection favors hardware rasterizer.
* @see #getGL2ES1(AbstractGraphicsDevice)
*/
@@ -750,7 +750,7 @@ public class GLProfile {
return get(defaultDevice, GL2ES1).getImpl();
}
- /**
+ /**
* Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
* It returns:
*
@@ -769,8 +769,8 @@ public class GLProfile {
return get(device, GL2ES2).getImpl();
}
- /**
- * Calls {@link #getGL2ES2(AbstractGraphicsDevice)} using the default device.
+ /**
+ * Calls {@link #getGL2ES2(AbstractGraphicsDevice)} using the default device.
*
Selection favors hardware rasterizer.
* @see #getGL2ES2(AbstractGraphicsDevice)
*/
@@ -780,7 +780,7 @@ public class GLProfile {
return get(defaultDevice, GL2ES2).getImpl();
}
- /**
+ /**
* Returns the GL4ES3 profile implementation, hence compatible w/ GL4ES3.
* It returns:
*
@@ -799,8 +799,8 @@ public class GLProfile {
return get(device, GL4ES3).getImpl();
}
- /**
- * Calls {@link #getGL4ES3(AbstractGraphicsDevice)} using the default device.
+ /**
+ * Calls {@link #getGL4ES3(AbstractGraphicsDevice)} using the default device.
*
Selection favors hardware rasterizer.
* @see #getGL4ES3(AbstractGraphicsDevice)
*/
@@ -810,7 +810,7 @@ public class GLProfile {
return get(defaultDevice, GL4ES3).getImpl();
}
- /**
+ /**
* Returns the GL2GL3 profile implementation, hence compatible w/ GL2GL3.
* It returns:
*
@@ -829,8 +829,8 @@ public class GLProfile {
return get(device, GL2GL3).getImpl();
}
- /**
- * Calls {@link #getGL2GL3(AbstractGraphicsDevice)} using the default device.
+ /**
+ * Calls {@link #getGL2GL3(AbstractGraphicsDevice)} using the default device.
*
Selection favors hardware rasterizer.
* @see #getGL2GL3(AbstractGraphicsDevice)
*/
@@ -846,7 +846,7 @@ public class GLProfile {
* the default profile.
*
* @param device a valid AbstractGraphicsDevice, or null for the default device.
- * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
+ * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
* or [ null, GL ] for the default profile.
* @throws GLException if the requested profile is not available for the device.
*/
@@ -864,8 +864,8 @@ public class GLProfile {
return glp;
}
- /** Uses the default device
- * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
+ /** Uses the default device
+ * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..),
* or [ null, GL ] for the default profile.
* @throws GLException if the requested profile is not available for the default device.
*/
@@ -881,14 +881,14 @@ public class GLProfile {
*
* @param device a valid AbstractGraphicsDevice, or null for the default device.
* @param profiles array of valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..)
- * @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false.
+ * @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false.
* @throws GLException if the non of the requested profiles is available for the device.
*/
public static GLProfile get(AbstractGraphicsDevice device, String[] profiles, boolean favorHardwareRasterizer)
throws GLException
{
GLProfile glProfileAny = null;
-
+
HashMap map = getProfileMap(device, true);
for(int i=0; i GL2, or GL3 -> GL3
+
+ /**
+ * return this profiles implementation name, eg. GL2ES2 -> GL2, or GL3 -> GL3
*/
public final String getImplName() {
return null != profileImpl ? profileImpl.getName() : getName();
@@ -1102,12 +1102,12 @@ public class GLProfile {
public final boolean isGLES2() {
return GLES2 == profile;
}
-
+
/** Indicates whether this profile is capable of GLES3.
Includes [ GLES3 ].
*/
public final boolean isGLES3() {
return GLES3 == profile;
}
-
+
/** Indicates whether this profile is capable of GLES.
Includes [ GLES3, GLES1, GLES2 ].
*/
public final boolean isGLES() {
return GLES3 == profile || GLES2 == profile || GLES1 == profile;
@@ -1122,21 +1122,21 @@ public class GLProfile {
public final boolean isGL2GL3() {
return GL2GL3 == profile || isGL3() || isGL2();
}
-
+
/** Indicates whether this profile is capable of GL2ES2.
- * @see #isGL3ES3()
- * @see #isGL2GL3()
+ * @see #isGL3ES3()
+ * @see #isGL2GL3()
*/
public final boolean isGL2ES3() {
return isGL3ES3() || isGL2GL3();
}
-
+
/** Indicates whether this profile is capable of GL3ES3.
Includes [ GL4bc, GL4, GL3bc, GL3, GLES3 ].
*/
public final boolean isGL3ES3() {
return isGL4ES3() || isGL3();
@@ -1172,7 +1172,7 @@ public class GLProfile {
return usesNativeGLES2() || usesNativeGLES1();
}
- /**
+ /**
* General validation if type is a valid GL data type
* for the current profile
*/
@@ -1200,14 +1200,14 @@ public class GLProfile {
if( isGL2() ) {
return true;
}
- }
+ }
if(throwException) {
throw new GLException("Illegal data type on profile "+this+": "+type);
}
return false;
}
-
- public boolean isValidArrayDataType(int index, int comps, int type,
+
+ public boolean isValidArrayDataType(int index, int comps, int type,
boolean isVertexAttribPointer, boolean throwException) {
final String arrayName = getGLArrayName(index);
if( isGLES1() ) {
@@ -1226,7 +1226,7 @@ public class GLProfile {
case GL.GL_FIXED:
case GL.GL_FLOAT:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
}
@@ -1238,7 +1238,7 @@ public class GLProfile {
case 3:
case 4:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
}
@@ -1252,7 +1252,7 @@ public class GLProfile {
case GL.GL_FIXED:
case GL.GL_FLOAT:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
}
@@ -1262,7 +1262,7 @@ public class GLProfile {
case 0:
case 3:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
}
@@ -1275,7 +1275,7 @@ public class GLProfile {
case GL.GL_FIXED:
case GL.GL_FLOAT:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
}
@@ -1285,7 +1285,7 @@ public class GLProfile {
case 0:
case 4:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
}
@@ -1303,7 +1303,7 @@ public class GLProfile {
case GL.GL_FLOAT:
case GL.GL_FIXED:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GLES2: "+type);
}
@@ -1317,7 +1317,7 @@ public class GLProfile {
case 3:
case 4:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GLES2: "+comps);
}
@@ -1335,7 +1335,7 @@ public class GLProfile {
case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
case javax.media.opengl.GL2.GL_DOUBLE:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
}
@@ -1348,7 +1348,7 @@ public class GLProfile {
case 3:
case 4:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
}
@@ -1363,7 +1363,7 @@ public class GLProfile {
case javax.media.opengl.GL2ES2.GL_INT:
case javax.media.opengl.GL2.GL_DOUBLE:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
}
@@ -1375,7 +1375,7 @@ public class GLProfile {
case 3:
case 4:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
}
@@ -1390,7 +1390,7 @@ public class GLProfile {
case javax.media.opengl.GL2ES2.GL_INT:
case javax.media.opengl.GL2.GL_DOUBLE:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
}
@@ -1400,7 +1400,7 @@ public class GLProfile {
case 0:
case 3:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
}
@@ -1418,7 +1418,7 @@ public class GLProfile {
case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
case javax.media.opengl.GL2.GL_DOUBLE:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
}
@@ -1429,7 +1429,7 @@ public class GLProfile {
case 3:
case 4:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
}
@@ -1443,7 +1443,7 @@ public class GLProfile {
case javax.media.opengl.GL2ES2.GL_INT:
case javax.media.opengl.GL2.GL_DOUBLE:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
}
@@ -1456,7 +1456,7 @@ public class GLProfile {
case 3:
case 4:
break;
- default:
+ default:
if(throwException) {
throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
}
@@ -1475,7 +1475,7 @@ public class GLProfile {
private static /*final*/ boolean isAWTAvailable;
- private static /*final*/ boolean hasDesktopGLFactory;
+ private static /*final*/ boolean hasDesktopGLFactory;
private static /*final*/ boolean hasGL234Impl;
private static /*final*/ boolean hasEGLFactory;
private static /*final*/ boolean hasGLES3Impl;
@@ -1508,11 +1508,11 @@ public class GLProfile {
// depends on hasDesktopGLFactory
hasGL234Impl = ReflectionUtil.isClassAvailable("jogamp.opengl.gl4.GL4bcImpl", classloader);
-
+
// depends on hasEGLFactory
hasGLES1Impl = ReflectionUtil.isClassAvailable("jogamp.opengl.es1.GLES1Impl", classloader);
hasGLES3Impl = ReflectionUtil.isClassAvailable("jogamp.opengl.es3.GLES3Impl", classloader);
-
+
//
// Iteration of desktop GL availability detection
// utilizing the detected GL version in the shared context.
@@ -1521,7 +1521,7 @@ public class GLProfile {
// which will register at GLContext ..
//
GLDrawableFactory.initSingleton();
-
+
Throwable t=null;
// if successfull it has a shared dummy drawable and context created
try {
@@ -1592,14 +1592,14 @@ public class GLProfile {
System.err.println("Info: GLProfile.init - EGL GLDrawable factory not available");
}
} else {
- defaultEGLDevice = eglFactory.getDefaultDevice();
+ defaultEGLDevice = eglFactory.getDefaultDevice();
}
if( null != defaultDesktopDevice ) {
defaultDevice = defaultDesktopDevice;
if(DEBUG) {
System.err.println("Info: GLProfile.init - Default device is desktop derived: "+defaultDevice);
- }
+ }
} else if ( null != defaultEGLDevice ) {
defaultDevice = defaultEGLDevice;
if(DEBUG) {
@@ -1611,12 +1611,12 @@ public class GLProfile {
}
defaultDevice = null;
}
-
+
// we require to initialize the EGL device 1st, if available
final boolean addedEGLProfile = null != defaultEGLDevice ? initProfilesForDevice(defaultEGLDevice) : false;
- final boolean addedDesktopProfile = null != defaultDesktopDevice ? initProfilesForDevice(defaultDesktopDevice) : false;
+ final boolean addedDesktopProfile = null != defaultDesktopDevice ? initProfilesForDevice(defaultDesktopDevice) : false;
final boolean addedAnyProfile = addedEGLProfile || addedDesktopProfile ;
-
+
if(DEBUG) {
System.err.println("GLProfile.init addedAnyProfile "+addedAnyProfile+" (desktop: "+addedDesktopProfile+", egl "+addedEGLProfile+")");
System.err.println("GLProfile.init isAWTAvailable "+isAWTAvailable);
@@ -1672,8 +1672,8 @@ public class GLProfile {
boolean addedDesktopProfile = false;
boolean addedEGLProfile = false;
- final boolean deviceIsDesktopCompatible = hasDesktopGLFactory && desktopFactory.getIsDeviceCompatible(device);
-
+ final boolean deviceIsDesktopCompatible = hasDesktopGLFactory && desktopFactory.getIsDeviceCompatible(device);
+
if( deviceIsDesktopCompatible ) {
// 1st pretend we have all Desktop and EGL profiles ..
computeProfileMap(device, true /* desktopCtxUndef*/, true /* esCtxUndef */);
@@ -1698,9 +1698,9 @@ public class GLProfile {
}
addedDesktopProfile = computeProfileMap(device, false /* desktopCtxUndef*/, false /* esCtxUndef */);
}
-
+
final boolean deviceIsEGLCompatible = hasEGLFactory && eglFactory.getIsDeviceCompatible(device);
-
+
// also test GLES1, GLES2 and GLES3 on desktop, since we have implementations / emulations available.
if( deviceIsEGLCompatible && ( hasGLES3Impl || hasGLES1Impl ) ) {
// 1st pretend we have all EGL profiles ..
@@ -1718,7 +1718,7 @@ public class GLProfile {
}
if(!eglSharedCtxAvail) {
// Remark: On Windows there is a libEGL.dll delivered w/ Chrome 15.0.874.121m and Firefox 8.0.1
- // but it seems even EGL.eglInitialize(eglDisplay, null, null)
+ // but it seems even EGL.eglInitialize(eglDisplay, null, null)
// fails in some scenarios (eg VirtualBox 4.1.6) w/ EGL error 0x3001 (EGL_NOT_INITIALIZED).
hasEGLFactory = false;
hasGLES3Impl = false;
@@ -1993,7 +1993,7 @@ public class GLProfile {
return null;
}
- private static /*final*/ HashMap> deviceConn2ProfileMap =
+ private static /*final*/ HashMap> deviceConn2ProfileMap =
new HashMap>();
/**
@@ -2004,22 +2004,22 @@ public class GLProfile {
*
* @param device the key 'device -> GLProfiles-Map'
* @param throwExceptionOnZeroProfile true if GLException shall be thrown in case of no mapped profile, otherwise false.
- * @return the GLProfile HashMap if exists, otherwise null
+ * @return the GLProfile HashMap if exists, otherwise null
* @throws GLException if no profile for the given device is available.
*/
- private static HashMap getProfileMap(AbstractGraphicsDevice device, boolean throwExceptionOnZeroProfile)
- throws GLException
+ private static HashMap getProfileMap(AbstractGraphicsDevice device, boolean throwExceptionOnZeroProfile)
+ throws GLException
{
initSingleton();
if(null==defaultDevice) { // avoid NPE and notify of incomplete initialization
throw new GLException("No default device available");
}
-
+
if(null==device) {
device = defaultDevice;
}
-
+
final String deviceKey = device.getUniqueID();
HashMap map = deviceConn2ProfileMap.get(deviceKey);
if( null != map ) {
diff --git a/src/jogl/classes/javax/media/opengl/GLRunnable.java b/src/jogl/classes/javax/media/opengl/GLRunnable.java
index 1ae1c9b22..ad68662ce 100644
--- a/src/jogl/classes/javax/media/opengl/GLRunnable.java
+++ b/src/jogl/classes/javax/media/opengl/GLRunnable.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 javax.media.opengl;
/**
@@ -33,8 +33,8 @@ package javax.media.opengl;
* Declares a one-shot OpenGL command usable for injection
* via {@link GLAutoDrawable#invoke(boolean, javax.media.opengl.GLRunnable)}.
* {@link GLAutoDrawable} executes the GLRunnables within it's {@link GLAutoDrawable#display() display()}
- * method after all registered {@link GLEventListener}s
- * {@link GLEventListener#display(GLAutoDrawable) display(GLAutoDrawable)}
+ * method after all registered {@link GLEventListener}s
+ * {@link GLEventListener#display(GLAutoDrawable) display(GLAutoDrawable)}
* methods has been called.
*
*
@@ -44,13 +44,13 @@ package javax.media.opengl;
* This might be useful to inject OpenGL commands from an I/O event listener.
*
*/
-public interface GLRunnable {
+public interface GLRunnable {
/**
* @param drawable the associated drawable and current context for this call
* @return true if the GL [back] framebuffer remains intact by this runnable, otherwise false.
* If returning false {@link GLAutoDrawable} will call
- * {@link GLEventListener#display(GLAutoDrawable) display(GLAutoDrawable)}
- * of all registered {@link GLEventListener}s once more.
+ * {@link GLEventListener#display(GLAutoDrawable) display(GLAutoDrawable)}
+ * of all registered {@link GLEventListener}s once more.
* @see GLRunnable
*/
boolean run(GLAutoDrawable drawable);
diff --git a/src/jogl/classes/javax/media/opengl/GLRunnable2.java b/src/jogl/classes/javax/media/opengl/GLRunnable2.java
index 1598a6215..5f0393257 100644
--- a/src/jogl/classes/javax/media/opengl/GLRunnable2.java
+++ b/src/jogl/classes/javax/media/opengl/GLRunnable2.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 javax.media.opengl;
/**
@@ -33,11 +33,11 @@ package javax.media.opengl;
* Declares a one-shot OpenGL command.
*
*/
-public interface GLRunnable2 {
+public interface GLRunnable2 {
/**
* @param gl a current GL object
* @param args custom arguments
- * @return the desired object
+ * @return the desired object
*/
T run(GL gl, U args);
}
diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java
index 60d0c58bf..700bba2eb 100644
--- a/src/jogl/classes/javax/media/opengl/GLUniformData.java
+++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java
@@ -77,16 +77,16 @@ public class GLUniformData {
sb = new StringBuilder();
}
sb.append("GLUniformData[name ").append(name).
- append(", location ").append(location).
+ append(", location ").append(location).
append(", size ").append(rows).append("x").append(columns).
- append(", count ").append(count).
- append(", data ");
+ append(", count ").append(count).
+ append(", data ");
if(isMatrix() && data instanceof FloatBuffer) {
sb.append("\n");
- final FloatBuffer fb = (FloatBuffer)getBuffer();
+ final FloatBuffer fb = (FloatBuffer)getBuffer();
for(int i=0; i
@@ -59,12 +59,12 @@ import jogamp.opengl.ThreadingImpl;
Due to these limitations, and due to the inherent multithreading
in the Java platform (in particular, in the Abstract Window
- Toolkit), it is often necessary to limit the multithreading
- occurring in the typical application using the OpenGL API.
+ Toolkit), it is often necessary to limit the multithreading
+ occurring in the typical application using the OpenGL API.
- In the current reference implementation, for instance, multithreading
+ In the current reference implementation, for instance, multithreading
has been limited by
forcing all OpenGL-related work for GLAutoDrawables on to a single
thread. In other words, if an application uses only the
@@ -93,9 +93,9 @@ import jogamp.opengl.ThreadingImpl;
This class also provides mechanisms for querying whether this
internal serialization of OpenGL work is in effect, and a
- programmatic way of disabling it. In the current reference
- implementation it is enabled by default, although it could be
- disabled in the future if OpenGL drivers become more robust on
+ programmatic way of disabling it. In the current reference
+ implementation it is enabled by default, although it could be
+ disabled in the future if OpenGL drivers become more robust on
all platforms.
@@ -113,7 +113,7 @@ import jogamp.opengl.ThreadingImpl;
platforms, and also the default behavior older releases)
-Djogl.1thread=worker Enable single-threading of OpenGL work on newly-created worker thread (not suitable for Mac
OS X or X11 platforms, and risky on Windows in applet environments)
-
+
*/
public class Threading {
@@ -121,9 +121,9 @@ public class Threading {
/** No reason to ever instantiate this class */
private 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
+ /** 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
@@ -133,7 +133,7 @@ public class Threading {
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() {
ThreadingImpl.disableSingleThreading();
}
@@ -145,11 +145,11 @@ public class Threading {
}
/** Indicates whether the current thread is the designated toolkit thread,
- if such semantics exists. */
+ if such semantics exists. */
public static final boolean isToolkitThread() throws GLException {
return ThreadingImpl.isToolkitThread();
}
-
+
/** Indicates whether the current thread is the single thread on
which this implementation of the javax.media.opengl APIs
performs all of its OpenGL-related work. This method should only
@@ -166,12 +166,12 @@ public class Threading {
thread (i.e., if isOpenGLThread() returns
false). It is up to the end user to check to see whether the
current thread is the OpenGL thread and either execute the
- Runnable directly or perform the work inside it.
+ Runnable directly or perform the work inside it.
**/
public static final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
ThreadingImpl.invokeOnOpenGLThread(wait, r);
}
-
+
/**
* If {@link #isSingleThreaded()} and not {@link #isOpenGLThread()}
* and the lock is not being hold by this thread,
@@ -179,14 +179,14 @@ public class Threading {
*
* Otherwise invoke Runnable r on the current thread.
*
- *
- * @param wait set to true for waiting until Runnable r is finished, otherwise false.
+ *
+ * @param wait set to true for waiting until Runnable r is finished, otherwise false.
* @param r the Runnable to be executed
* @param lock optional lock object to be tested
* @throws GLException
*/
public static final void invoke(boolean wait, Runnable r, Object lock) throws GLException {
- if ( isSingleThreaded() && !isOpenGLThread() &&
+ if ( isSingleThreaded() && !isOpenGLThread() &&
( null == lock || !Thread.holdsLock(lock) ) ) {
invokeOnOpenGLThread(wait, r);
} else {
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL2.java b/src/jogl/classes/javax/media/opengl/TraceGL2.java
index 58f5d9f99..c577332e9 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL2.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL2.java
@@ -12,7 +12,7 @@ import java.io.PrintStream;
* Sample code which installs this pipeline, manual:
*
+ *
* For automatic instantiation see {@link GLPipelineFactory#create(String, Class, GL, Object[])}.
*
*/
diff --git a/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java b/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java
index 0c4f63c2d..5feaa5760 100644
--- a/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java
+++ b/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java
@@ -1,21 +1,21 @@
/*
* 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
@@ -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.
*/
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index 6828beb10..f08fbafe8 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -115,15 +115,15 @@ import jogamp.opengl.awt.AWTTilePainter;
of Z-ordering or LayoutManager problems.
*
*
- *
+ *
* {@link OffscreenLayerOption#setShallUseOffscreenLayer(boolean) setShallUseOffscreenLayer(true)}
- * maybe called to use an offscreen drawable (FBO or PBuffer) allowing
+ * maybe called to use an offscreen drawable (FBO or PBuffer) allowing
* the underlying JAWT mechanism to composite the image, if supported.
*
* {@link OffscreenLayerOption#setShallUseOffscreenLayer(boolean) setShallUseOffscreenLayer(true)}
* is being called if {@link GLCapabilitiesImmutable#isOnscreen()} is false.
*
*
* To avoid any conflicts with a potential Java2D OpenGL context,
@@ -274,7 +274,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public final Object getUpstreamWidget() {
return this;
}
-
+
@Override
public void setShallUseOffscreenLayer(boolean v) {
shallUseOffscreenLayer = v;
@@ -315,11 +315,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* all platforms since the peer hasn't been created.
*/
final GraphicsConfiguration gc = super.getGraphicsConfiguration();
-
+
if( Beans.isDesignTime() ) {
return gc;
}
-
+
/*
* chosen is only non-null on platforms where the GLDrawableFactory
* returns a non-null GraphicsConfiguration (in the GLCanvas
@@ -431,11 +431,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
_lock.unlock();
}
}
-
+
private final void setRealizedImpl(boolean realized) {
final RecursiveLock _lock = lock;
_lock.lock();
- try {
+ try {
final GLDrawable _drawable = drawable;
if( null == _drawable || realized == _drawable.isRealized() ||
realized && ( 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) ) {
@@ -448,10 +448,10 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
} finally {
_lock.unlock();
}
- }
+ }
private final Runnable realizeOnEDTAction = new Runnable() { public void run() { setRealizedImpl(true); } };
private final Runnable unrealizeOnEDTAction = new Runnable() { public void run() { setRealizedImpl(false); } };
-
+
@Override
public final void setRealized(boolean realized) {
// Make sure drawable realization happens on AWT-EDT and only there. Consider the AWTTree lock!
@@ -503,7 +503,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void destroy() {
destroyImpl( false );
}
-
+
protected void destroyImpl(boolean destroyJAWTWindowAndAWTDevice) {
Threading.invoke(true, destroyOnEDTAction, getTreeLock());
if( destroyJAWTWindowAndAWTDevice ) {
@@ -553,14 +553,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void addNotify() {
final RecursiveLock _lock = lock;
_lock.lock();
- try {
+ try {
final boolean isBeansDesignTime = Beans.isDesignTime();
-
+
if(DEBUG) {
System.err.println(getThreadName()+": Info: addNotify - start, bounds: "+this.getBounds()+", isBeansDesignTime "+isBeansDesignTime);
// Thread.dumpStack();
}
-
+
if( isBeansDesignTime ) {
super.addNotify();
} else {
@@ -576,21 +576,21 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if(null==awtConfig) {
throw new GLException("Error: NULL AWTGraphicsConfiguration");
}
-
+
// before native peer is valid: X11
disableBackgroundErase();
-
+
// issues getGraphicsConfiguration() and creates the native peer
super.addNotify();
-
+
// after native peer is valid: Windows
disableBackgroundErase();
-
+
createDrawableAndContext( true );
-
+
// init drawable by paint/display makes the init sequence more equal
// for all launch flavors (applet/javaws/..)
- // validateGLDrawable();
+ // validateGLDrawable();
}
awtWindowClosingProtocol.addClosingListener();
@@ -606,7 +606,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if ( !Beans.isDesignTime() ) {
if( createJAWTWindow ) {
jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(this, awtConfig);
- jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer);
+ jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer);
}
jawtWindow.lockSurface();
try {
@@ -617,7 +617,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
jawtWindow.unlockSurface();
}
}
- }
+ }
private boolean validateGLDrawable() {
if( Beans.isDesignTime() || !isDisplayable() ) {
@@ -641,7 +641,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
return false;
}
-
+
/**
Overridden to track when this component is removed from a
container. Subclasses which override this method must call
super.removeNotify() in their removeNotify() method in order to
@@ -686,13 +686,13 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void reshape(int x, int y, int width, int height) {
synchronized (getTreeLock()) { // super.reshape(..) claims tree lock, so we do extend it's lock over reshape
super.reshape(x, y, width, height);
-
+
if(DEBUG) {
final NativeSurface ns = getNativeSurface();
final long nsH = null != ns ? ns.getSurfaceHandle() : 0;
System.err.println("GLCanvas.sizeChanged: ("+getThreadName()+"): "+width+"x"+height+" - surfaceHandle 0x"+Long.toHexString(nsH));
// Thread.dumpStack();
- }
+ }
if( validateGLDrawable() && !printActive ) {
final GLDrawableImpl _drawable = drawable;
if( ! _drawable.getChosenGLCapabilities().isOnscreen() ) {
@@ -701,7 +701,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
try {
final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, width, height);
if(_drawable != _drawableNew) {
- // write back
+ // write back
drawable = _drawableNew;
}
} finally {
@@ -723,13 +723,13 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
private volatile boolean printActive = false;
- private GLAnimatorControl printAnimator = null;
+ private GLAnimatorControl printAnimator = null;
private GLAutoDrawable printGLAD = null;
private AWTTilePainter printAWTTiles = null;
-
+
@Override
public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
- printActive = true;
+ printActive = true;
final int componentCount = isOpaque() ? 3 : 4;
final TileRenderer printRenderer = new TileRenderer();
printAWTTiles = new AWTTilePainter(printRenderer, componentCount, scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight, DEBUG);
@@ -742,14 +742,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if(DEBUG) {
System.err.println(getThreadName()+": Info: GLCanvas setupPrint - skipped GL render, drawable not valid yet");
}
- printActive = false;
+ printActive = false;
return; // not yet available ..
}
if( !isVisible() ) {
if(DEBUG) {
System.err.println(getThreadName()+": Info: GLCanvas setupPrint - skipped GL render, drawable visible");
}
- printActive = false;
+ printActive = false;
return; // not yet available ..
}
sendReshape = false; // clear reshape flag
@@ -757,7 +757,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if( null != printAnimator ) {
printAnimator.remove(GLCanvas.this);
}
- printGLAD = GLCanvas.this; // _not_ default, shall be replaced by offscreen GLAD
+ printGLAD = GLCanvas.this; // _not_ default, shall be replaced by offscreen GLAD
final GLCapabilities caps = (GLCapabilities)getChosenGLCapabilities().cloneMutable();
final int printNumSamples = printAWTTiles.getNumSamples(caps);
GLDrawable printDrawable = printGLAD.getDelegatedDrawable();
@@ -783,8 +783,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
caps.setNumSamples(printNumSamples);
}
final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
- printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
- printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
+ printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
+ printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
printAWTTiles.customTileHeight != -1 ? printAWTTiles.customTileHeight : DEFAULT_PRINT_TILE_SIZE,
null);
GLDrawableUtil.swapGLContextAndAllGLEventListener(GLCanvas.this, printGLAD);
@@ -801,7 +801,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
}
};
-
+
@Override
public void releasePrint() {
if( !printActive || null == printGLAD ) {
@@ -832,7 +832,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
display();
}
};
-
+
@Override
public void print(Graphics graphics) {
if( !printActive || null == printGLAD ) {
@@ -843,7 +843,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
// we cannot dispatch print on AWT-EDT due to printing internal locking ..
}
sendReshape = false; // clear reshape flag
-
+
final Graphics2D g2d = (Graphics2D)graphics;
try {
printAWTTiles.setupGraphics2DAndClipBounds(g2d, getWidth(), getHeight());
@@ -876,7 +876,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
System.err.println("AWT print.X: "+printAWTTiles);
}
}
-
+
@Override
public void addGLEventListener(GLEventListener listener) {
helper.addGLEventListener(listener);
@@ -906,14 +906,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
-
+
@Override
public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
Threading.invoke(true, r, getTreeLock());
return r.listener;
}
-
+
@Override
public GLEventListener removeGLEventListener(GLEventListener listener) {
return helper.removeGLEventListener(listener);
@@ -948,7 +948,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public boolean invoke(final boolean wait, final List glRunnables) {
return helper.invoke(this, wait, glRunnables);
}
-
+
@Override
public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
final RecursiveLock _lock = lock;
@@ -967,7 +967,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public final GLDrawable getDelegatedDrawable() {
return drawable;
}
-
+
@Override
public GLContext getContext() {
return context;
@@ -1049,7 +1049,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
final GLDrawable _drawable = drawable;
return null != _drawable ? _drawable.isGLOriented() : true;
}
-
+
@Override
public NativeSurface getNativeSurface() {
final GLDrawable _drawable = drawable;
@@ -1093,7 +1093,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void run() {
final RecursiveLock _lock = lock;
_lock.lock();
- try {
+ try {
final GLAnimatorControl animator = getAnimator();
if(DEBUG) {
@@ -1101,7 +1101,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
(null!=context) + ", hasDrawable " + (null!=drawable)+", "+animator);
// Thread.dumpStack();
}
-
+
final boolean animatorPaused;
if(null!=animator) {
// can't remove us from animator for recreational addNotify()
@@ -1109,7 +1109,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
} else {
animatorPaused = false;
}
-
+
// OLS will be detached by disposeGL's context destruction below
if( null != context ) {
if( context.isCreated() ) {
@@ -1137,11 +1137,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if(animatorPaused) {
animator.resume();
}
-
+
if(DEBUG) {
System.err.println(getThreadName()+": dispose() - END, animator "+animator);
}
-
+
} finally {
_lock.unlock();
}
@@ -1170,7 +1170,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
jawtWindow=null;
}
-
+
if(null != awtConfig) {
final AbstractGraphicsConfiguration aconfig = awtConfig.getNativeGraphicsConfiguration();
final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
@@ -1188,7 +1188,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
awtConfig=null;
}
};
-
+
private final Runnable initAction = new Runnable() {
@Override
public void run() {
@@ -1250,7 +1250,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
this.listener = listener;
this.remove = remove;
}
-
+
@Override
public void run() {
final RecursiveLock _lock = lock;
@@ -1262,7 +1262,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
}
};
-
+
// Disables the AWT's erasing of this Canvas's background on Windows
// in Java SE 6. This internal API is not available in previous
// releases, but the system property
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 1ec0ad7bc..84db62515 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -129,7 +129,7 @@ import com.jogamp.opengl.util.texture.TextureState;
In case the above mentioned GLSL vertical-flipping is not performed,
- {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line.
+ {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line.
This step causes more CPU load per frame and is not hardware-accelerated.
The FBO / GLSL code path uses one texture-unit and binds the FBO texture to it's active texture-target,
see {@link #setTextureUnit(int)} and {@link #getTextureUnit()}.
@@ -154,7 +154,7 @@ import com.jogamp.opengl.util.texture.TextureState;
Warning (Bug 842): Certain GL states other than viewport and texture (see above)
influencing rendering, will also influence the GLSL vertical flip, e.g. {@link GL#glFrontFace(int) glFrontFace}({@link GL#GL_CCW}).
It is recommended to reset those states to default when leaving the {@link GLEventListener#display(GLAutoDrawable)} method!
- We may change this behavior in the future, i.e. preserve all influencing states.
+ We may change this behavior in the future, i.e. preserve all influencing states.
*/
@@ -162,23 +162,23 @@ import com.jogamp.opengl.util.texture.TextureState;
public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosingProtocol, AWTPrintLifecycle {
private static final boolean DEBUG;
private static final boolean DEBUG_VIEWPORT;
- private static final boolean USE_GLSL_TEXTURE_RASTERIZER;
+ private static final boolean USE_GLSL_TEXTURE_RASTERIZER;
/** Indicates whether the Java 2D OpenGL pipeline is requested by user. */
private static final boolean java2dOGLEnabledByProp;
-
+
/** Indicates whether the Java 2D OpenGL pipeline is enabled, resource-compatible and requested by user. */
private static final boolean useJava2DGLPipeline;
-
+
/** Indicates whether the Java 2D OpenGL pipeline's usage is error free. */
private static boolean java2DGLPipelineOK;
-
+
static {
Debug.initSingleton();
DEBUG = Debug.debug("GLJPanel");
DEBUG_VIEWPORT = Debug.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true);
USE_GLSL_TEXTURE_RASTERIZER = !Debug.isPropertyDefined("jogl.gljpanel.noglsl", true);
-
+
boolean enabled = Debug.getBooleanProperty("sun.java2d.opengl", false);
java2dOGLEnabledByProp = enabled && !Debug.isPropertyDefined("jogl.gljpanel.noogl", true);
@@ -201,7 +201,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
System.err.println("GLJPanel: java2DGLPipelineOK "+java2DGLPipelineOK);
}
}
-
+
private static SingleAWTGLPixelBufferProvider singleAWTGLPixelBufferProvider = null;
private static synchronized SingleAWTGLPixelBufferProvider getSingleAWTGLPixelBufferProvider() {
if( null == singleAWTGLPixelBufferProvider ) {
@@ -209,7 +209,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
return singleAWTGLPixelBufferProvider;
}
-
+
private GLDrawableHelper helper = new GLDrawableHelper();
private volatile boolean isInitialized;
@@ -236,14 +236,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// Width of the actual GLJPanel: reshapeWidth -> panelWidth -> backend.width
private int panelWidth = 0;
private int panelHeight = 0;
-
+
// These are always set to (0, 0) except when the Java2D / OpenGL
// pipeline is active
private int viewportX;
private int viewportY;
private int requestedTextureUnit = 0; // default
-
+
// The backend in use
private volatile Backend backend;
@@ -316,7 +316,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
this.factory = GLDrawableFactoryImpl.getFactoryImpl(glProfile);
this.chooser = ((chooser != null) ? chooser : new DefaultGLCapabilitiesChooser());
this.shareWith = shareWith;
-
+
this.setFocusable(true); // allow keyboard input!
}
@@ -336,12 +336,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
customPixelBufferProvider = custom;
}
-
+
@Override
public final Object getUpstreamWidget() {
return this;
}
-
+
@Override
public void display() {
if( isVisible() ) {
@@ -446,7 +446,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
handleReshape = false;
sendReshape = handleReshape();
}
-
+
if( isVisible() ) {
updater.setGraphics(g);
backend.doPaintComponent(g);
@@ -489,7 +489,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
which override this method must call super.reshape() in
their reshape() method in order to function properly.
*
- * {@inheritDoc}
+ * {@inheritDoc}
*/
@SuppressWarnings("deprecation")
@Override
@@ -500,7 +500,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
System.err.println(getThreadName()+": GLJPanel.reshape resize"+(printActive?"WithinPrint":"")+" [ panel "+
panelWidth+"x"+panelHeight +
", reshape: " +reshapeWidth+"x"+reshapeHeight +
- "] -> "+(printActive?"skipped":"") + width+"x"+height);
+ "] -> "+(printActive?"skipped":"") + width+"x"+height);
}
if( !printActive ) {
reshapeWidth = width;
@@ -510,13 +510,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
private volatile boolean printActive = false;
- private GLAnimatorControl printAnimator = null;
+ private GLAnimatorControl printAnimator = null;
private GLAutoDrawable printGLAD = null;
private AWTTilePainter printAWTTiles = null;
-
+
@Override
public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
- printActive = true;
+ printActive = true;
final int componentCount = isOpaque() ? 3 : 4;
final TileRenderer printRenderer = new TileRenderer();
printAWTTiles = new AWTTilePainter(printRenderer, componentCount, scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight, DEBUG);
@@ -532,14 +532,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if(DEBUG) {
System.err.println(getThreadName()+": Info: GLJPanel setupPrint - skipped GL render, drawable not valid yet");
}
- printActive = false;
+ printActive = false;
return; // not yet available ..
}
if( !isVisible() ) {
if(DEBUG) {
System.err.println(getThreadName()+": Info: GLJPanel setupPrint - skipped GL render, drawable visible");
}
- printActive = false;
+ printActive = false;
return; // not yet available ..
}
sendReshape = false; // clear reshape flag
@@ -548,8 +548,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if( null != printAnimator ) {
printAnimator.remove(GLJPanel.this);
}
-
- printGLAD = GLJPanel.this; // default: re-use
+
+ printGLAD = GLJPanel.this; // default: re-use
final GLCapabilities caps = (GLCapabilities)getChosenGLCapabilities().cloneMutable();
final int printNumSamples = printAWTTiles.getNumSamples(caps);
GLDrawable printDrawable = printGLAD.getDelegatedDrawable();
@@ -570,8 +570,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
caps.setSampleBuffers(0 < printNumSamples);
caps.setNumSamples(printNumSamples);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
- printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
- printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
+ printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
+ printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
printAWTTiles.customTileHeight != -1 ? printAWTTiles.customTileHeight : DEFAULT_PRINT_TILE_SIZE,
null);
GLDrawableUtil.swapGLContextAndAllGLEventListener(GLJPanel.this, printGLAD);
@@ -588,7 +588,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
}
};
-
+
@Override
public void releasePrint() {
if( !printActive ) {
@@ -598,7 +598,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
handleReshape = false; // ditto
AWTEDTExecutor.singleton.invoke(getTreeLock(), true /* allowOnNonEDT */, true /* wait */, releasePrintOnEDT);
}
-
+
private final Runnable releasePrintOnEDT = new Runnable() {
@Override
public void run() {
@@ -616,7 +616,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
printAnimator.add(GLJPanel.this);
printAnimator = null;
}
-
+
// trigger reshape, i.e. gl-viewport and -listener - this component might got resized!
final int awtWidth = GLJPanel.this.getWidth();
final int awtHeight= GLJPanel.this.getHeight();
@@ -639,7 +639,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
display();
}
};
-
+
@Override
public void print(Graphics graphics) {
if( !printActive ) {
@@ -651,7 +651,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
sendReshape = false; // clear reshape flag
handleReshape = false; // ditto
-
+
final Graphics2D g2d = (Graphics2D)graphics;
try {
printAWTTiles.setupGraphics2DAndClipBounds(g2d, getWidth(), getHeight());
@@ -691,7 +691,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
print(g);
}
-
+
@Override
public void setOpaque(boolean opaque) {
if (backend != null) {
@@ -729,7 +729,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
-
+
@Override
public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
@@ -746,7 +746,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
return r.listener;
}
-
+
@Override
public GLEventListener removeGLEventListener(GLEventListener listener) {
return helper.removeGLEventListener(listener);
@@ -781,7 +781,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
public boolean invoke(final boolean wait, final List glRunnables) {
return helper.invoke(this, wait, glRunnables);
}
-
+
@Override
public GLContext createContext(GLContext shareWith) {
final Backend b = backend;
@@ -821,7 +821,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
return b.getDrawable();
}
-
+
@Override
public GLContext getContext() {
final Backend b = backend;
@@ -918,7 +918,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
return b.getDrawable().isGLOriented();
}
-
+
@Override
public GLCapabilitiesImmutable getChosenGLCapabilities() {
final Backend b = backend;
@@ -956,11 +956,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
return factory;
}
- /**
+ /**
* Returns the used texture unit, i.e. a value of [0..n], or -1 if non used.
*
* If implementation uses a texture-unit, it will be known only after the first initialization, i.e. display call.
- *
@@ -970,9 +970,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if ( null == b ) {
return -1;
}
- return b.getTextureUnit();
+ return b.getTextureUnit();
}
-
+
/**
* Allows user to request a texture unit to be used,
* must be called before the first initialization, i.e. {@link #display()} call.
@@ -982,14 +982,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
*
- *
+ *
* @param v requested texture unit
* @see #getTextureUnit()
*/
public final void setTextureUnit(int v) {
requestedTextureUnit = v;
}
-
+
//----------------------------------------------------------------------
// Internals only below this point
//
@@ -1004,7 +1004,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (DEBUG) {
System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend: " +panelWidth+"x"+panelHeight + " -> " + reshapeWidth+"x"+reshapeHeight);
- }
+ }
// Pull down reshapeWidth and reshapeHeight into panelWidth and
// panelHeight eagerly in order to complete initialization, and
// force a reshape later
@@ -1039,7 +1039,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private boolean handleReshape() {
if (DEBUG) {
System.err.println(getThreadName()+": GLJPanel.handleReshape: " +panelWidth+"x"+panelHeight + " -> " + reshapeWidth+"x"+reshapeHeight);
- }
+ }
panelWidth = reshapeWidth;
panelHeight = reshapeHeight;
@@ -1089,7 +1089,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
public void plainPaint(GLAutoDrawable drawable) {
helper.display(GLJPanel.this);
}
-
+
@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
// This is handled above and dispatched directly to the appropriate context
@@ -1148,7 +1148,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
updater.plainPaint(GLJPanel.this);
}
};
-
+
private final Runnable paintImmediatelyAction = new Runnable() {
@Override
public void run() {
@@ -1172,7 +1172,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
}
};
-
+
private int getGLInteger(GL gl, int which) {
int[] tmp = new int[1];
gl.glGetIntegerv(which, tmp, 0);
@@ -1203,7 +1203,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
/** Called when the opacity of the GLJPanel is changed */
public void setOpaque(boolean opaque);
- /**
+ /**
* Called to manually create an additional OpenGL context against
* this GLJPanel
*/
@@ -1220,7 +1220,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
/** Returns the used texture unit, i.e. a value of [0..n], or -1 if non used. */
public int getTextureUnit();
-
+
/** Called to fetch the "real" GLCapabilities for the backend */
public GLCapabilitiesImmutable getChosenGLCapabilities();
@@ -1240,7 +1240,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
*/
public boolean preGL(Graphics g);
- /**
+ /**
* Called after the OpenGL work is done in init() and display().
* The isDisplay argument indicates whether this was called on
* behalf of a call to display() rather than init().
@@ -1262,7 +1262,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private final boolean useSingletonBuffer;
private AWTGLPixelBuffer pixelBuffer;
private BufferedImage alignedImage;
-
+
// One of these is used to store the read back pixels before storing
// in the BufferedImage
protected IntBuffer readBackIntsForCPUVFlip;
@@ -1272,10 +1272,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private boolean offscreenIsFBO;
private FBObject fboFlipped;
private GLSLTextureRaster glslTextureRaster;
-
+
private GLContextImpl offscreenContext;
- private boolean flipVertical;
-
+ private boolean flipVertical;
+
// For saving/restoring of OpenGL state during ReadPixels
private final GLPixelStorageModes psm = new GLPixelStorageModes();
@@ -1291,7 +1291,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
useSingletonBuffer = false;
}
}
-
+
@Override
public boolean isUsingOwnLifecycle() { return false; }
@@ -1351,11 +1351,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
} else {
fboFlipped = null;
glslTextureRaster = null;
- }
+ }
offscreenContext.release();
} else {
isInitialized = false;
- }
+ }
} finally {
if( !isInitialized ) {
if(null != offscreenContext) {
@@ -1376,7 +1376,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
System.err.println(getThreadName()+": OffscreenBackend: destroy() - offscreenContext: "+(null!=offscreenContext)+" - offscreenDrawable: "+(null!=offscreenDrawable));
}
if ( null != offscreenContext && offscreenContext.isCreated() ) {
- if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {
+ if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {
try {
final GL gl = offscreenContext.getGL();
if(null != glslTextureRaster) {
@@ -1394,7 +1394,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
glslTextureRaster = null;
fboFlipped = null;
offscreenContext = null;
-
+
if (offscreenDrawable != null) {
final AbstractGraphicsDevice adevice = offscreenDrawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
offscreenDrawable.setRealized(false);
@@ -1404,8 +1404,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
}
offscreenIsFBO = false;
-
- if( null != readBackIntsForCPUVFlip ) {
+
+ if( null != readBackIntsForCPUVFlip ) {
readBackIntsForCPUVFlip.clear();
readBackIntsForCPUVFlip = null;
}
@@ -1449,10 +1449,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
componentCount = 4;
alignment = 4;
}
-
- final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, componentCount);
-
- if( useSingletonBuffer ) { // attempt to fetch the latest AWTGLPixelBuffer
+
+ final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, componentCount);
+
+ if( useSingletonBuffer ) { // attempt to fetch the latest AWTGLPixelBuffer
pixelBuffer = (AWTGLPixelBuffer) ((SingletonGLPixelBufferProvider)pixelBufferProvider).getSingleBuffer(pixelAttribs);
}
if( null != pixelBuffer && pixelBuffer.requiresNewBuffer(gl, panelWidth, panelHeight, 0) ) {
@@ -1463,7 +1463,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if ( null == pixelBuffer ) {
if (0 >= panelWidth || 0 >= panelHeight ) {
return;
- }
+ }
pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, panelWidth, panelHeight, 1, true, 0);
if(DEBUG) {
System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: pixelBufferProvider isSingletonBufferProvider "+useSingletonBuffer+", 0x"+Integer.toHexString(pixelBufferProvider.hashCode())+", "+pixelBufferProvider.getClass().getSimpleName());
@@ -1482,7 +1482,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
}
final IntBuffer readBackInts;
-
+
if( !flipVertical || null != glslTextureRaster ) {
readBackInts = (IntBuffer) pixelBuffer.buffer;
} else {
@@ -1494,7 +1494,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
final TextureState usrTexState, fboTexState;
final int fboTexUnit = GL.GL_TEXTURE0 + ( offscreenIsFBO ? ((GLFBODrawable)offscreenDrawable).getTextureUnit() : 0 );
-
+
if( offscreenIsFBO ) {
usrTexState = new TextureState(gl, GL.GL_TEXTURE_2D);
if( fboTexUnit != usrTexState.getUnit() ) {
@@ -1510,9 +1510,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
usrTexState = null;
fboTexState = null;
}
-
+
// Must now copy pixels from offscreen context into surface
-
+
// Save current modes
psm.setAlignment(gl, alignment, alignment);
if(gl.isGL2ES3()) {
@@ -1520,14 +1520,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
gl2es3.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, panelWidth);
gl2es3.glReadBuffer(gl2es3.getDefaultReadBuffer());
}
-
+
offscreenDrawable.swapBuffers();
-
+
if(null != glslTextureRaster) { // implies flippedVertical
final boolean viewportChange;
final int[] usrViewport = new int[] { 0, 0, 0, 0 };
gl.glGetIntegerv(GL.GL_VIEWPORT, usrViewport, 0);
- viewportChange = 0 != usrViewport[0] || 0 != usrViewport[1] ||
+ viewportChange = 0 != usrViewport[0] || 0 != usrViewport[1] ||
offscreenDrawable.getWidth() != usrViewport[2] || offscreenDrawable.getHeight() != usrViewport[3];
if( DEBUG_VIEWPORT ) {
System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL: Viewport: change "+viewportChange+
@@ -1536,21 +1536,21 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
if( viewportChange ) {
gl.glViewport(0, 0, offscreenDrawable.getWidth(), offscreenDrawable.getHeight());
- }
-
- // perform vert-flipping via OpenGL/FBO
+ }
+
+ // perform vert-flipping via OpenGL/FBO
final GLFBODrawable fboDrawable = (GLFBODrawable)offscreenDrawable;
final FBObject.TextureAttachment fboTex = fboDrawable.getTextureBuffer(GL.GL_FRONT);
-
+
fboFlipped.bind(gl);
-
+
// gl.glActiveTexture(GL.GL_TEXTURE0 + fboDrawable.getTextureUnit()); // implicit by GLFBODrawableImpl: swapBuffers/contextMadeCurent -> swapFBOImpl
- gl.glBindTexture(GL.GL_TEXTURE_2D, fboTex.getName());
+ gl.glBindTexture(GL.GL_TEXTURE_2D, fboTex.getName());
// gl.glClear(GL.GL_DEPTH_BUFFER_BIT); // fboFlipped runs w/o DEPTH!
-
+
glslTextureRaster.display(gl.getGL2ES2());
gl.glReadPixels(0, 0, panelWidth, panelHeight, pixelAttribs.format, pixelAttribs.type, readBackInts);
-
+
fboFlipped.unbind(gl);
if( viewportChange ) {
gl.glViewport(usrViewport[0], usrViewport[1], usrViewport[2], usrViewport[3]);
@@ -1558,7 +1558,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
fboTexState.restore(gl);
} else {
gl.glReadPixels(0, 0, panelWidth, panelHeight, pixelAttribs.format, pixelAttribs.type, readBackInts);
-
+
if ( flipVertical ) {
// Copy temporary data into raster of BufferedImage for faster
// blitting Note that we could avoid this copy in the cases
@@ -1586,7 +1586,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// correctness on all platforms
}
}
-
+
@Override
public int getTextureUnit() {
if(null != glslTextureRaster && null != offscreenDrawable) { // implies flippedVertical
@@ -1598,16 +1598,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
@Override
public void doPaintComponent(Graphics g) {
helper.invokeGL(offscreenDrawable, offscreenContext, updaterDisplayAction, updaterInitAction);
-
+
if ( null != alignedImage ) {
// Draw resulting image in one shot
g.drawImage(alignedImage, 0, 0, alignedImage.getWidth(), alignedImage.getHeight(), null); // Null ImageObserver since image data is ready.
}
}
-
+
@Override
public void doPlainPaint() {
- helper.invokeGL(offscreenDrawable, offscreenContext, updaterPlainDisplayAction, updaterInitAction);
+ helper.invokeGL(offscreenDrawable, offscreenContext, updaterPlainDisplayAction, updaterInitAction);
}
@Override
@@ -1616,7 +1616,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
{
final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, offscreenContext, panelWidth, panelHeight);
if(_drawable != _drawableNew) {
- // write back
+ // write back
_drawable = _drawableNew;
offscreenDrawable = _drawableNew;
}
@@ -1626,9 +1626,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
panelWidth = _drawable.getWidth();
panelHeight = _drawable.getHeight();
-
+
if( null != glslTextureRaster ) {
- if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {
+ if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {
try {
final GL gl = offscreenContext.getGL();
fboFlipped.reset(gl, _drawable.getWidth(), _drawable.getHeight(), 0, false);
@@ -1640,7 +1640,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
return _drawable.isRealized();
}
-
+
@Override
public GLContext createContext(GLContext shareWith) {
return (null != offscreenDrawable) ? offscreenDrawable.createContext(shareWith) : null;
@@ -1790,7 +1790,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
@Override
public int getTextureUnit() { return -1; }
-
+
@Override
public GLCapabilitiesImmutable getChosenGLCapabilities() {
// FIXME: should do better than this; is it possible to using only platform-independent code?
@@ -2114,9 +2114,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
@Override
public void doPlainPaint() {
- helper.invokeGL(joglDrawable, joglContext, updaterPlainDisplayAction, updaterInitAction);
+ helper.invokeGL(joglDrawable, joglContext, updaterPlainDisplayAction, updaterInitAction);
}
-
+
private void captureJ2DState(GL gl, Graphics g) {
gl.glGetIntegerv(GL2.GL_DRAW_BUFFER, drawBuffer, 0);
gl.glGetIntegerv(GL2.GL_READ_BUFFER, readBuffer, 0);
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
index 9fee0a2e2..b4d788329 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
@@ -58,18 +58,18 @@ public interface GLMatrixFunc {
* which is the same behavior than the native JOGL GL impl
*/
public void glGetFloatv(int pname, java.nio.FloatBuffer params);
-
+
/**
* Copy the named matrix to the given storage at offset.
* @param pname {@link #GL_MODELVIEW_MATRIX}, {@link #GL_PROJECTION_MATRIX} or {@link #GL_TEXTURE_MATRIX}
* @param params storage
* @param params_offset storage offset
- */
+ */
public void glGetFloatv(int pname, float[] params, int params_offset);
-
+
/**
* glGetIntegerv
- * @param pname {@link #GL_MATRIX_MODE} to receive the current matrix mode
+ * @param pname {@link #GL_MATRIX_MODE} to receive the current matrix mode
* @param params the FloatBuffer's position remains unchanged
* which is the same behavior than the native JOGL GL impl
*/
@@ -89,7 +89,7 @@ public interface GLMatrixFunc {
*
*/
public void glPushMatrix();
-
+
/**
* Pop the current matrix from it's stack.
* @see #glPushMatrix()
@@ -97,19 +97,19 @@ public interface GLMatrixFunc {
public void glPopMatrix();
/**
- * Load the current matrix with the identity matrix
+ * Load the current matrix with the identity matrix
*/
public void glLoadIdentity() ;
/**
- * Load the current matrix w/ the provided one.
+ * Load the current matrix w/ the provided one.
* @param params the FloatBuffer's position remains unchanged,
* which is the same behavior than the native JOGL GL impl
*/
- public void glLoadMatrixf(java.nio.FloatBuffer m) ;
+ public void glLoadMatrixf(java.nio.FloatBuffer m) ;
/**
* Load the current matrix w/ the provided one.
- */
+ */
public void glLoadMatrixf(float[] m, int m_offset);
/**
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
index 786835f4d..4aff24b36 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
@@ -31,7 +31,7 @@ package javax.media.opengl.fixedfunc;
import javax.media.opengl.*;
-public interface GLPointerFunc {
+public interface GLPointerFunc {
public static final int GL_VERTEX_ARRAY = 0x8074;
public static final int GL_NORMAL_ARRAY = 0x8075;
public static final int GL_COLOR_ARRAY = 0x8076;
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
index 79ec38e0c..9bd644223 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
@@ -28,7 +28,7 @@
package javax.media.opengl.fixedfunc;
-public class GLPointerFuncUtil {
+public class GLPointerFuncUtil {
public static final String mgl_Vertex = "mgl_Vertex";
public static final String mgl_Normal = "mgl_Normal";
public static final String mgl_Color = "mgl_Color";
@@ -37,16 +37,16 @@ public class GLPointerFuncUtil {
/**
* @param glArrayIndex the fixed function array index
- * @return default fixed function array name
+ * @return default fixed function array name
*/
public static String getPredefinedArrayIndexName(int glArrayIndex) {
return getPredefinedArrayIndexName(glArrayIndex, -1);
}
-
+
/**
* @param glArrayIndex the fixed function array index
- * @param multiTexCoordIndex index for multiTexCoordIndex
- * @return default fixed function array name
+ * @param multiTexCoordIndex index for multiTexCoordIndex
+ * @return default fixed function array name
*/
public static String getPredefinedArrayIndexName(int glArrayIndex, int multiTexCoordIndex) {
switch(glArrayIndex) {
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java
index 1f59b5805..515583b14 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java
@@ -30,20 +30,20 @@ package jogamp.graph.curve.opengl;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.GLRegion;
-/** RegionFactory to create a Context specific Region implementation.
- *
+/** RegionFactory to create a Context specific Region implementation.
+ *
* @see GLRegion
*/
public class RegionFactory {
-
+
/**
* Create a Region using the passed render mode
- *
+ *
*
In case {@link Region#VBAA_RENDERING_BIT} is being requested the default texture unit
* {@link Region#TWO_PASS_DEFAULT_TEXTURE_UNIT} is being used.
- *
+ *
* @param rs the RenderState to be used
- * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
+ * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
*/
public static GLRegion create(int renderModes) {
if( 0 != ( Region.VBAA_RENDERING_BIT & renderModes ) ){
@@ -53,18 +53,18 @@ public class RegionFactory {
return new VBORegionSPES2(renderModes);
}
}
-
+
/** Create a Single Pass Region using the passed render mode
- * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
+ * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
* {@link Region#VBAA_RENDERING_BIT}
* @return
*/
public static GLRegion createSinglePass(int renderModes) {
return new VBORegionSPES2(renderModes);
}
-
+
/** Create a Two Pass (VBAA) Region using the passed render mode
- * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
+ * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
* {@link Region#VBAA_RENDERING_BIT}
* @return
*/
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
index 7f5afcd02..22600cb89 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
@@ -43,12 +43,12 @@ import com.jogamp.opengl.util.glsl.ShaderState;
public class RegionRendererImpl01 extends RegionRenderer {
public RegionRendererImpl01(RenderState rs, int renderModes) {
super(rs, renderModes);
-
+
}
-
+
protected boolean initShaderProgram(GL2ES2 gl) {
final ShaderState st = rs.getShaderState();
-
+
final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RegionRendererImpl01.class, "shader",
"shader/bin", getVertexShaderName(), true);
final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RegionRendererImpl01.class, "shader",
@@ -57,29 +57,29 @@ public class RegionRendererImpl01 extends RegionRenderer {
// rsFp.defaultShaderCustomization(gl, true, true);
int pos = rsFp.addGLSLVersion(gl);
if( gl.isGLES2() ) {
- pos = rsFp.insertShaderSource(0, pos, ShaderCode.extOESDerivativesEnable);
+ pos = rsFp.insertShaderSource(0, pos, ShaderCode.extOESDerivativesEnable);
}
final String rsFpDefPrecision = getFragmentShaderPrecision(gl);
if( null != rsFpDefPrecision ) {
rsFp.insertShaderSource(0, pos, rsFpDefPrecision);
}
-
+
final ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
sp.add(rsFp);
- if( !sp.init(gl) ) {
+ if( !sp.init(gl) ) {
throw new GLException("RegionRenderer: Couldn't init program: "+sp);
}
- st.attachShaderProgram(gl, sp, false);
+ st.attachShaderProgram(gl, sp, false);
st.bindAttribLocation(gl, AttributeNames.VERTEX_ATTR_IDX, AttributeNames.VERTEX_ATTR_NAME);
- st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);
-
+ st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);
+
if(!sp.link(gl, System.err)) {
throw new GLException("RegionRenderer: Couldn't link program: "+sp);
- }
+ }
st.useProgram(gl, true);
-
+
if(DEBUG) {
System.err.println("RegionRendererImpl01 initialized: " + Thread.currentThread()+" "+st);
}
@@ -94,5 +94,5 @@ public class RegionRendererImpl01 extends RegionRenderer {
@Override
protected void drawImpl(GL2ES2 gl, Region region, float[] position, int[] texSize) {
((GLRegion)region).draw(gl, rs, vp_width, vp_height, texSize);
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
index 51356ca13..8ca29b9f0 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
@@ -38,9 +38,9 @@ import com.jogamp.graph.geom.Vertex;
import com.jogamp.opengl.util.PMVMatrix;
import com.jogamp.opengl.util.glsl.ShaderState;
-public class RenderStateImpl extends RenderState {
+public class RenderStateImpl extends RenderState {
/**
- * weight is equivalent to the
+ * weight is equivalent to the
* global off-curve vertex weight.
* TODO: change to per vertex
*/
@@ -50,7 +50,7 @@ public class RenderStateImpl extends RenderState {
public RenderStateImpl(ShaderState st, Vertex.Factory extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
super(st, pointFactory, pmvMatrix);
-
+
gcu_Weight = new GLUniformData(UniformNames.gcu_Weight, 1.0f);
st.ownUniform(gcu_PMVMatrix);
gcu_Alpha = new GLUniformData(UniformNames.gcu_Alpha, 1.0f);
@@ -60,15 +60,15 @@ public class RenderStateImpl extends RenderState {
// gcu_Strength = new GLUniformData(UniformNames.gcu_Strength, 3.0f);
// st.ownUniform(gcu_Strength);
}
-
+
public RenderStateImpl(ShaderState st, Vertex.Factory extends Vertex> pointFactory) {
this(st, pointFactory, new PMVMatrix());
}
-
+
public final GLUniformData getWeight() { return gcu_Weight; }
public final GLUniformData getAlpha() { return gcu_Alpha; }
public final GLUniformData getColorStatic() { return gcu_ColorStatic; }
//public final GLUniformData getStrength() { return gcu_Strength; }
-
-
+
+
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
index 81c421371..60758b90b 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
@@ -40,11 +40,11 @@ import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
import com.jogamp.opengl.util.glsl.ShaderState;
-public class TextRendererImpl01 extends TextRenderer {
+public class TextRendererImpl01 extends TextRenderer {
public TextRendererImpl01(RenderState rs, int type) {
- super(rs, type);
+ super(rs, type);
}
-
+
@Override
protected boolean initShaderProgram(GL2ES2 gl){
final ShaderState st = rs.getShaderState();
@@ -63,18 +63,18 @@ public class TextRendererImpl01 extends TextRenderer {
if( null != rsFpDefPrecision ) {
rsFp.insertShaderSource(0, pos, rsFpDefPrecision);
}
-
+
final ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
sp.add(rsFp);
-
- if( !sp.init(gl) ) {
+
+ if( !sp.init(gl) ) {
throw new GLException("RegionRenderer: Couldn't init program: "+sp);
}
- st.attachShaderProgram(gl, sp, false);
+ st.attachShaderProgram(gl, sp, false);
st.bindAttribLocation(gl, AttributeNames.VERTEX_ATTR_IDX, AttributeNames.VERTEX_ATTR_NAME);
- st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);
-
+ st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);
+
if(!sp.link(gl, System.err)) {
throw new GLException("TextRendererImpl01: Couldn't link program: "+sp);
}
@@ -82,15 +82,15 @@ public class TextRendererImpl01 extends TextRenderer {
if(DEBUG) {
System.err.println("TextRendererImpl01 initialized: " + Thread.currentThread()+" "+st);
- }
+ }
return true;
}
-
+
@Override
protected void destroyImpl(GL2ES2 gl) {
super.destroyImpl(gl);
}
-
+
@Override
public void drawString3D(GL2ES2 gl, Font font, String str, float[] position, int fontSize, int[/*1*/] texSize) {
if(!isInitialized()){
@@ -101,7 +101,7 @@ public class TextRendererImpl01 extends TextRenderer {
glyphString = createString(gl, font, fontSize, str);
addCachedGlyphString(gl, font, str, fontSize, glyphString);
}
-
+
glyphString.renderString3D(gl, rs, vp_width, vp_height, texSize);
}
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
index 85d3ad5a7..86c0db8c6 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
@@ -30,7 +30,7 @@ package jogamp.graph.curve.opengl;
import java.nio.FloatBuffer;
import javax.media.opengl.GL2ES2;
-// FIXME: Subsume GL2GL3.GL_DRAW_FRAMEBUFFER -> GL2ES2.GL_DRAW_FRAMEBUFFER !
+// FIXME: Subsume GL2GL3.GL_DRAW_FRAMEBUFFER -> GL2ES2.GL_DRAW_FRAMEBUFFER !
import javax.media.opengl.GL;
import javax.media.opengl.GLUniformData;
import javax.media.opengl.fixedfunc.GLMatrixFunc;
@@ -58,90 +58,90 @@ public class VBORegion2PES2 extends GLRegion {
private GLArrayDataServer verticeFboAttr;
private GLArrayDataServer texCoordFboAttr;
private GLArrayDataServer indicesFbo;
-
-
+
+
private FBObject fbo;
private TextureAttachment texA;
private PMVMatrix fboPMVMatrix;
GLUniformData mgl_fboPMVMatrix;
-
+
private int tex_width_c = 0;
private int tex_height_c = 0;
- GLUniformData mgl_ActiveTexture;
+ GLUniformData mgl_ActiveTexture;
GLUniformData mgl_TextureSize; // if GLSL < 1.30
-
+
public VBORegion2PES2(int renderModes, int textureEngine) {
super(renderModes);
fboPMVMatrix = new PMVMatrix();
- mgl_fboPMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, fboPMVMatrix.glGetPMvMatrixf());
- mgl_ActiveTexture = new GLUniformData(UniformNames.gcu_TextureUnit, textureEngine);
+ mgl_fboPMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, fboPMVMatrix.glGetPMvMatrixf());
+ mgl_ActiveTexture = new GLUniformData(UniformNames.gcu_TextureUnit, textureEngine);
}
-
+
public void update(GL2ES2 gl, RenderState rs) {
if(!isDirty()) {
- return;
+ return;
}
if(null == indicesFbo) {
final int initialElementCount = 256;
final ShaderState st = rs.getShaderState();
-
- indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+
+ indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
indicesFbo.seal(true);
-
- texCoordFboAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+
+ texCoordFboAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
st.ownAttribute(texCoordFboAttr, true);
- texCoordFboAttr.putf(5); texCoordFboAttr.putf(5);
- texCoordFboAttr.putf(5); texCoordFboAttr.putf(6);
- texCoordFboAttr.putf(6); texCoordFboAttr.putf(6);
- texCoordFboAttr.putf(6); texCoordFboAttr.putf(5);
+ texCoordFboAttr.putf(5); texCoordFboAttr.putf(5);
+ texCoordFboAttr.putf(5); texCoordFboAttr.putf(6);
+ texCoordFboAttr.putf(6); texCoordFboAttr.putf(6);
+ texCoordFboAttr.putf(6); texCoordFboAttr.putf(5);
texCoordFboAttr.seal(true);
-
- verticeFboAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
- false, initialElementCount, GL.GL_STATIC_DRAW);
+
+ verticeFboAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ false, initialElementCount, GL.GL_STATIC_DRAW);
st.ownAttribute(verticeFboAttr, true);
-
-
- indicesTxt = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
-
- verticeTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+
+
+ indicesTxt = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+
+ verticeTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
st.ownAttribute(verticeTxtAttr, true);
-
- texCoordTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+
+ texCoordTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
st.ownAttribute(texCoordTxtAttr, true);
-
+
if(DEBUG_INSTANCE) {
System.err.println("VBORegion2PES2 Create: " + this);
- }
+ }
}
// process triangles
indicesTxt.seal(gl, false);
- indicesTxt.rewind();
+ indicesTxt.rewind();
for(int i=0; i maxTexSize[0]) {
texWidth[0] = maxTexSize[0]; // clip to max - write-back user value!
}
- renderRegion2FBO(gl, rs, texWidth);
+ renderRegion2FBO(gl, rs, texWidth);
}
// System.out.println("Scale: " + matrix.glGetMatrixf().get(1+4*3) +" " + matrix.glGetMatrixf().get(2+4*3));
renderFBO(gl, rs, vp_width, vp_height);
}
}
-
+
private void renderFBO(GL2ES2 gl, RenderState rs, int width, int hight) {
final ShaderState st = rs.getShaderState();
-
- gl.glViewport(0, 0, width, hight);
- st.uniform(gl, mgl_ActiveTexture);
+
+ gl.glViewport(0, 0, width, hight);
+ st.uniform(gl, mgl_ActiveTexture);
gl.glActiveTexture(GL.GL_TEXTURE0 + mgl_ActiveTexture.intValue());
- fbo.use(gl, texA);
- verticeFboAttr.enableBuffer(gl, true);
- texCoordFboAttr.enableBuffer(gl, true);
+ fbo.use(gl, texA);
+ verticeFboAttr.enableBuffer(gl, true);
+ texCoordFboAttr.enableBuffer(gl, true);
indicesFbo.bindBuffer(gl, true); // keeps VBO binding
-
+
gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
-
- indicesFbo.bindBuffer(gl, false);
+
+ indicesFbo.bindBuffer(gl, false);
texCoordFboAttr.enableBuffer(gl, false);
- verticeFboAttr.enableBuffer(gl, false);
+ verticeFboAttr.enableBuffer(gl, false);
fbo.unuse(gl);
-
+
// setback: gl.glActiveTexture(currentActiveTextureEngine[0]);
}
-
+
private void renderRegion2FBO(GL2ES2 gl, RenderState rs, int[/*1*/] texWidth) {
final ShaderState st = rs.getShaderState();
-
+
if(0>=texWidth[0]) {
throw new IllegalArgumentException("texWidth must be greater than 0: "+texWidth[0]);
}
-
+
tex_width_c = texWidth[0];
tex_height_c = (int) ( ( ( tex_width_c * box.getHeight() ) / box.getWidth() ) + 0.5f );
-
+
// System.out.println("FBO Size: "+texWidth[0]+" -> "+tex_width_c+"x"+tex_height_c);
// System.out.println("FBO Scale: " + m.glGetMatrixf().get(0) +" " + m.glGetMatrixf().get(5));
-
+
if(null != fbo && fbo.getWidth() != tex_width_c && fbo.getHeight() != tex_height_c ) {
fbo.reset(gl, tex_width_c, tex_height_c);
}
-
- if(null == fbo) {
+
+ if(null == fbo) {
fbo = new FBObject();
- fbo.reset(gl, tex_width_c, tex_height_c);
+ fbo.reset(gl, tex_width_c, tex_height_c);
// FIXME: shall not use bilinear, due to own AA ? However, w/o bilinear result is not smooth
texA = fbo.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
// texA = fbo.attachTexture2D(gl, 0, GL2ES2.GL_NEAREST, GL2ES2.GL_NEAREST, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
@@ -260,18 +260,18 @@ public class VBORegion2PES2 extends GLRegion {
} else {
fbo.bind(gl);
}
-
+
//render texture
gl.glViewport(0, 0, tex_width_c, tex_height_c);
st.uniform(gl, mgl_fboPMVMatrix); // use orthogonal matrix
-
+
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
renderRegion(gl);
fbo.unbind(gl);
-
+
st.uniform(gl, rs.getPMVMatrix()); // switch back to real PMV matrix
-
+
// if( !gl.isGL3() ) {
// GLSL < 1.30
if(null == mgl_TextureSize) {
@@ -281,21 +281,21 @@ public class VBORegion2PES2 extends GLRegion {
texSize.put(0, (float)fbo.getWidth());
texSize.put(1, (float)fbo.getHeight());
st.uniform(gl, mgl_TextureSize);
- //}
+ //}
}
-
+
private void renderRegion(GL2ES2 gl) {
- verticeTxtAttr.enableBuffer(gl, true);
+ verticeTxtAttr.enableBuffer(gl, true);
texCoordTxtAttr.enableBuffer(gl, true);
indicesTxt.bindBuffer(gl, true); // keeps VBO binding
-
+
gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesTxt.getElementCount() * indicesTxt.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
-
- indicesTxt.bindBuffer(gl, false);
+
+ indicesTxt.bindBuffer(gl, false);
texCoordTxtAttr.enableBuffer(gl, false);
- verticeTxtAttr.enableBuffer(gl, false);
+ verticeTxtAttr.enableBuffer(gl, false);
}
-
+
public void destroy(GL2ES2 gl, RenderState rs) {
if(DEBUG_INSTANCE) {
System.err.println("VBORegion2PES2 Destroy: " + this);
@@ -305,7 +305,7 @@ public class VBORegion2PES2 extends GLRegion {
fbo.destroy(gl);
fbo = null;
texA = null;
- }
+ }
if(null != verticeTxtAttr) {
st.ownAttribute(verticeTxtAttr, false);
verticeTxtAttr.destroy(gl);
@@ -335,6 +335,6 @@ public class VBORegion2PES2 extends GLRegion {
indicesFbo = null;
}
triangles.clear();
- vertices.clear();
- }
+ vertices.clear();
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 0cba444ad..0a867b45c 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -44,13 +44,13 @@ public class VBORegionSPES2 extends GLRegion {
private GLArrayDataServer texCoordAttr = null;
private GLArrayDataServer indices = null;
- protected VBORegionSPES2(int renderModes) {
+ protected VBORegionSPES2(int renderModes) {
super(renderModes);
}
protected void update(GL2ES2 gl, RenderState rs) {
if(!isDirty()) {
- return;
+ return;
}
if(null == indices) {
@@ -59,11 +59,11 @@ public class VBORegionSPES2 extends GLRegion {
indices = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- verticeAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
- false, initialElementCount, GL.GL_STATIC_DRAW);
+ verticeAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ false, initialElementCount, GL.GL_STATIC_DRAW);
st.ownAttribute(verticeAttr, true);
- texCoordAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+ texCoordAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
st.ownAttribute(texCoordAttr, true);
@@ -74,7 +74,7 @@ public class VBORegionSPES2 extends GLRegion {
// process triangles
indices.seal(gl, false);
- indices.rewind();
+ indices.rewind();
for(int i=0; i loops;
private ArrayList vertices;
-
+
private ArrayList triangles;
private int maxTriID = 0;
-
+
/** Constructor for a new Delaunay triangulator
*/
public CDTriangulator2D() {
reset();
}
-
+
/** Reset the triangulation to initial state
* Clearing cached data
*/
@@ -71,14 +71,14 @@ public class CDTriangulator2D implements Triangulator{
triangles = new ArrayList(3);
loops = new ArrayList();
}
-
+
public void addCurve(Outline polyline) {
Loop loop = null;
-
+
if(!loops.isEmpty()) {
loop = getContainerLoop(polyline);
}
-
+
if(loop == null) {
GraphOutline outline = new GraphOutline(polyline);
GraphOutline innerPoly = extractBoundaryTriangles(outline, false);
@@ -92,8 +92,8 @@ public class CDTriangulator2D implements Triangulator{
loop.addConstraintCurve(innerPoly);
}
}
-
- public ArrayList generate() {
+
+ public ArrayList generate() {
for(int i=0;i vertices = polyline.getVertices();
for(int i=0; i < loops.size(); i++) {
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
index c8251af15..2e8d4f58f 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
@@ -35,13 +35,13 @@ import com.jogamp.graph.geom.Vertex;
public class GraphOutline {
final private Outline outline;
final private ArrayList controlpoints = new ArrayList(3);
-
+
public GraphOutline(){
this.outline = new Outline();
}
-
+
/**Create a control polyline of control vertices
- * the curve pieces can be identified by onCurve flag
+ * the curve pieces can be identified by onCurve flag
* of each cp the control polyline is open by default
*/
public GraphOutline(Outline ol){
@@ -59,7 +59,7 @@ public class GraphOutline {
public ArrayList getGraphPoint() {
return controlpoints;
}
-
+
public ArrayList getVertices() {
return outline.getVertices();
}
@@ -68,5 +68,5 @@ public class GraphOutline {
controlpoints.add(v);
outline.addVertex(v.getPoint());
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
index 52d02baa5..1ef1d8c7f 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
@@ -35,7 +35,7 @@ public class GraphVertex {
private Vertex point;
private ArrayList edges = null;
private boolean boundaryContained = false;
-
+
public GraphVertex(Vertex point) {
this.point = point;
}
@@ -43,15 +43,15 @@ public class GraphVertex {
public Vertex getPoint() {
return point;
}
-
+
public float getX(){
return point.getX();
}
-
+
public float getY(){
return point.getY();
}
-
+
public float getZ(){
return point.getZ();
}
@@ -70,7 +70,7 @@ public class GraphVertex {
public void setEdges(ArrayList edges) {
this.edges = edges;
}
-
+
public void addEdge(HEdge edge){
if(edges == null){
edges = new ArrayList();
@@ -112,7 +112,7 @@ public class GraphVertex {
}
return null;
}
-
+
public boolean isBoundaryContained() {
return boundaryContained;
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
index 4d29a81f3..acaa3d708 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
@@ -35,14 +35,14 @@ public class HEdge {
public static int BOUNDARY = 3;
public static int INNER = 1;
public static int HOLE = 2;
-
+
private GraphVertex vert;
private HEdge prev = null;
private HEdge next = null;
private HEdge sibling = null;
private int type = BOUNDARY;
private Triangle triangle = null;
-
+
public HEdge(GraphVertex vert, int type) {
this.vert = vert;
this.type = type;
@@ -112,19 +112,19 @@ public class HEdge {
public void setTriangle(Triangle triangle) {
this.triangle = triangle;
}
-
+
public static void connect(HEdge first, HEdge next){
first.setNext(next);
next.setPrev(first);
}
-
+
public static void makeSiblings(HEdge first, HEdge second){
first.setSibling(second);
second.setSibling(first);
}
-
+
public boolean vertexOnCurveVertex(){
return vert.getPoint().isOnCurve();
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
index 651179062..c1dafc0d1 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
@@ -51,7 +51,7 @@ public class Loop {
public Triangle cut(boolean delaunay){
if(isSimplex()){
- Triangle t = new Triangle(root.getGraphPoint().getPoint(), root.getNext().getGraphPoint().getPoint(),
+ Triangle t = new Triangle(root.getGraphPoint().getPoint(), root.getNext().getGraphPoint().getPoint(),
root.getNext().getNext().getGraphPoint().getPoint());
t.setVerticesBoundary(checkVerticesBoundary(root));
return t;
@@ -103,20 +103,20 @@ public class Loop {
throw new IllegalArgumentException("outline's vertices < 3: " + vertices.size());
}
final VectorUtil.Winding hasWinding = VectorUtil.getWinding(
- vertices.get(0).getPoint(),
+ vertices.get(0).getPoint(),
vertices.get(1).getPoint(),
vertices.get(2).getPoint());
//FIXME: handle case when vertices come inverted - Rami
// skips inversion CW -> CCW
final boolean invert = hasWinding != reqWinding &&
reqWinding == VectorUtil.Winding.CW;
-
+
final int max;
final int edgeType = reqWinding == VectorUtil.Winding.CCW ? HEdge.BOUNDARY : HEdge.HOLE ;
int index;
HEdge firstEdge = null;
HEdge lastEdge = null;
-
+
if(!invert) {
max = vertices.size();
index = 0;
@@ -160,7 +160,7 @@ public class Loop {
public void addConstraintCurve(GraphOutline polyline) {
// GraphOutline outline = new GraphOutline(polyline);
/**needed to generate vertex references.*/
- initFromPolyline(polyline, VectorUtil.Winding.CW);
+ initFromPolyline(polyline, VectorUtil.Winding.CW);
GraphVertex v3 = locateClosestVertex(polyline);
HEdge v3Edge = v3.findBoundEdge();
@@ -180,9 +180,9 @@ public class Loop {
HEdge.connect(crossEdgeSib, root);
}
- /** Locates the vertex and update the loops root
- * to have (root + vertex) as closest pair
- * @param polyline the control polyline
+ /** Locates the vertex and update the loops root
+ * to have (root + vertex) as closest pair
+ * @param polyline the control polyline
* to search for closestvertices
* @return the vertex that is closest to the newly set root Hedge.
*/
@@ -205,7 +205,7 @@ public class Loop {
for (GraphVertex vert:vertices){
if(vert == v || vert == nextV || vert == cand)
continue;
- inValid = VectorUtil.inCircle(v.getPoint(), nextV.getPoint(),
+ inValid = VectorUtil.inCircle(v.getPoint(), nextV.getPoint(),
cand.getPoint(), vert.getPoint());
if(inValid){
break;
@@ -243,8 +243,8 @@ public class Loop {
Vertex cand = candEdge.getGraphPoint().getPoint();
HEdge e = candEdge.getNext();
while (e != candEdge){
- if(e.getGraphPoint() == root.getGraphPoint()
- || e.getGraphPoint() == next.getGraphPoint()
+ if(e.getGraphPoint() == root.getGraphPoint()
+ || e.getGraphPoint() == next.getGraphPoint()
|| e.getGraphPoint().getPoint() == cand){
e = e.getNext();
continue;
@@ -311,15 +311,15 @@ public class Loop {
(v.getX() < (v2.getX() - v1.getX()) * (v.getY() - v1.getY()) / (v2.getY() - v1.getY()) + v1.getX()) ){
inside = !inside;
}
-
+
current = next;
next = current.getNext();
-
+
} while(current != root);
-
+
return inside;
}
-
+
public int computeLoopSize(){
int size = 0;
HEdge e = root;
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
index 751a7e7ac..ff46c3338 100644
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
+++ b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
@@ -37,17 +37,17 @@ import com.jogamp.graph.curve.OutlineShape;
import com.jogamp.opengl.math.Quaternion;
public class GlyphShape {
-
+
private Quaternion quat= null;
private OutlineShape shape = null;
-
+
/** Create a new Glyph shape
* based on Parametric curve control polyline
*/
public GlyphShape(Vertex.Factory extends Vertex> factory){
shape = new OutlineShape(factory);
}
-
+
/** Create a new GlyphShape from a {@link OutlineShape}
* @param factory vertex impl factory {@link Factory}
* @param shape {@link OutlineShape} representation of the Glyph
@@ -57,24 +57,24 @@ public class GlyphShape {
this.shape = shape;
this.shape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
}
-
+
public final Vertex.Factory extends Vertex> vertexFactory() { return shape.vertexFactory(); }
-
+
public OutlineShape getShape() {
return shape;
}
-
+
public int getNumVertices() {
return shape.getVertices().size();
}
-
+
/** Get the rotational Quaternion attached to this Shape
* @return the Quaternion Object
*/
public Quaternion getQuat() {
return quat;
}
-
+
/** Set the Quaternion that shall defien the rotation
* of this shape.
* @param quat
@@ -82,7 +82,7 @@ public class GlyphShape {
public void setQuat(Quaternion quat) {
this.quat = quat;
}
-
+
/** Triangluate the glyph shape
* @return ArrayList of triangles which define this shape
*/
@@ -95,5 +95,5 @@ public class GlyphShape {
*/
public ArrayList getVertices(){
return shape.getVertices();
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
index cc850b823..2284ab669 100644
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
+++ b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
@@ -52,51 +52,51 @@ public class GlyphString {
*
The actual font size shall be accomplished by the GL PMV matrix.
*/
public static final int STATIC_FONT_SIZE = 10;
-
+
private ArrayList glyphs = new ArrayList();
private CharSequence str;
private String fontname;
private GLRegion region;
-
+
private SVertex origin = new SVertex();
/**
*
Uses {@link #STATIC_FONT_SIZE}.
*
No caching is performed.
- *
+ *
* @param shape is not null, add all {@link GlyphShape}'s {@link Outline} to this instance.
* @param vertexFactory vertex impl factory {@link Factory}
- * @param font the target {@link Font}
+ * @param font the target {@link Font}
* @param str string text
* @return the created {@link GlyphString} instance
*/
public static GlyphString createString(OutlineShape shape, Factory extends Vertex> vertexFactory, Font font, String str) {
- return createString(shape, vertexFactory, font, STATIC_FONT_SIZE, str);
+ return createString(shape, vertexFactory, font, STATIC_FONT_SIZE, str);
}
-
+
/**
*
No caching is performed.
- *
+ *
* @param shape is not null, add all {@link GlyphShape}'s {@link Outline} to this instance.
* @param vertexFactory vertex impl factory {@link Factory}
- * @param font the target {@link Font}
+ * @param font the target {@link Font}
* @param fontSize font size
* @param str string text
* @return the created {@link GlyphString} instance
*/
public static GlyphString createString(OutlineShape shape, Factory extends Vertex> vertexFactory, Font font, int fontSize, String str) {
ArrayList shapes = ((FontInt)font).getOutlineShapes(str, fontSize, vertexFactory);
-
+
GlyphString glyphString = new GlyphString(font.getName(Font.NAME_UNIQUNAME), str);
glyphString.createfromOutlineShapes(vertexFactory, shapes);
if(null != shape) {
for(int i=0; i vertexFactory, ArrayList shapes) {
final int numGlyps = shapes.size();
@@ -126,31 +126,31 @@ public class GlyphString {
continue;
}
GlyphShape glyphShape = new GlyphShape(vertexFactory, shapes.get(index));
-
+
if(glyphShape.getNumVertices() < 3) {
continue;
- }
+ }
addGlyphShape(glyphShape);
}
}
-
-
+
+
/** Generate a OGL Region to represent this Object.
* @param gl the current gl object
* @param rs the current attached RenderState
- * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
+ * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
*/
public GLRegion createRegion(GL2ES2 gl, int renderModes){
region = RegionFactory.create(renderModes);
// region.setFlipped(true);
-
+
int numVertices = region.getNumVertices();
-
+
for(int i=0; i< glyphs.size(); i++) {
final GlyphShape glyph = glyphs.get(i);
ArrayList gtris = glyph.triangulate();
region.addTriangles(gtris);
-
+
final ArrayList gVertices = glyph.getVertices();
for(int j=0; j getOutlineShapes(CharSequence string, float pixelSize, Factory extends Vertex> vertexFactory);
diff --git a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
index 3736c5f13..5978e937d 100644
--- a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
@@ -40,16 +40,16 @@ import com.jogamp.graph.font.FontSet;
import com.jogamp.graph.font.FontFactory;
public class JavaFontLoader implements FontSet {
-
- // FIXME: Add cache size to limit memory usage
+
+ // FIXME: Add cache size to limit memory usage
private static final IntObjectHashMap fontMap = new IntObjectHashMap();
-
+
private static final FontSet fontLoader = new JavaFontLoader();
public static FontSet get() {
return fontLoader;
}
-
+
final static String availableFontFileNames[] =
{
/* 00 */ "LucidaBrightRegular.ttf",
@@ -61,9 +61,9 @@ public class JavaFontLoader implements FontSet {
/* 06 */ "LucidaTypewriterRegular.ttf",
/* 07 */ "LucidaTypewriterBold.ttf",
};
-
+
final String javaFontPath;
-
+
private JavaFontLoader() {
final String javaHome = AccessController.doPrivileged(new PrivilegedAction() {
public String run() {
@@ -80,11 +80,11 @@ public class JavaFontLoader implements FontSet {
static boolean is(int bits, int bit) {
return 0 != ( bits & bit ) ;
}
-
+
public Font getDefault() throws IOException {
- return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular
+ return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular
}
-
+
public Font get(int family, int style) throws IOException {
Font font = (Font)fontMap.get( ( family << 8 ) | style );
if (font != null) {
@@ -92,8 +92,8 @@ public class JavaFontLoader implements FontSet {
}
// 1st process Sans Serif (2 fonts)
- if( is(style, STYLE_SERIF) ) {
- if( is(style, STYLE_BOLD) ) {
+ if( is(style, STYLE_SERIF) ) {
+ if( is(style, STYLE_BOLD) ) {
font = abspath(availableFontFileNames[5], family, style);
} else {
font = abspath(availableFontFileNames[4], family, style);
@@ -103,53 +103,53 @@ public class JavaFontLoader implements FontSet {
}
return font;
}
-
+
// Serif Fonts ..
switch (family) {
case FAMILY_LIGHT:
case FAMILY_MEDIUM:
case FAMILY_CONDENSED:
case FAMILY_REGULAR:
- if( is(style, STYLE_BOLD) ) {
- if( is(style, STYLE_ITALIC) ) {
+ if( is(style, STYLE_BOLD) ) {
+ if( is(style, STYLE_ITALIC) ) {
font = abspath(availableFontFileNames[3], family, style);
} else {
font = abspath(availableFontFileNames[2], family, style);
}
- } else if( is(style, STYLE_ITALIC) ) {
+ } else if( is(style, STYLE_ITALIC) ) {
font = abspath(availableFontFileNames[1], family, style);
} else {
font = abspath(availableFontFileNames[0], family, style);
}
break;
-
+
case FAMILY_MONOSPACED:
- if( is(style, STYLE_BOLD) ) {
+ if( is(style, STYLE_BOLD) ) {
font = abspath(availableFontFileNames[7], family, style);
} else {
font = abspath(availableFontFileNames[6], family, style);
}
- break;
+ break;
}
return font;
}
-
+
Font abspath(String fname, int family, int style) throws IOException {
if(null == javaFontPath) {
throw new GLException("java font path undefined");
}
final String err = "Problem loading font "+fname+", file "+javaFontPath+fname ;
-
+
try {
final Font f = FontFactory.get( new File(javaFontPath+fname) );
if(null != f) {
fontMap.put( ( family << 8 ) | style, f );
return f;
}
- throw new IOException (err);
+ throw new IOException (err);
} catch (IOException ioe) {
- throw new IOException(err, ioe);
+ throw new IOException(err, ioe);
}
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
index c4c580290..254583739 100644
--- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
@@ -39,23 +39,23 @@ import com.jogamp.graph.font.FontFactory;
import java.net.URLConnection;
public class UbuntuFontLoader implements FontSet {
-
- // FIXME: Add cache size to limit memory usage
+
+ // FIXME: Add cache size to limit memory usage
private static final IntObjectHashMap fontMap = new IntObjectHashMap();
-
- private static final String relPath = "fonts/ubuntu/" ;
-
+
+ private static final String relPath = "fonts/ubuntu/" ;
+
private static final FontSet fontLoader = new UbuntuFontLoader();
public static final FontSet get() {
return fontLoader;
}
-
+
final static String availableFontFileNames[] =
{
/* 00 */ "Ubuntu-R.ttf", // regular
/* 01 */ "Ubuntu-RI.ttf", // regular italic
- /* 02 */ "Ubuntu-B.ttf", // bold
+ /* 02 */ "Ubuntu-B.ttf", // bold
/* 03 */ "Ubuntu-BI.ttf", // bold italic
/* 04 */ "Ubuntu-L.ttf", // light
/* 05 */ "Ubuntu-LI.ttf", // light italic
@@ -63,18 +63,18 @@ public class UbuntuFontLoader implements FontSet {
/* 07 */ "Ubuntu-MI.ttf", // medium italic
};
-
+
private UbuntuFontLoader() {
}
static boolean is(int bits, int bit) {
return 0 != ( bits & bit ) ;
}
-
+
public Font getDefault() throws IOException {
- return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular
+ return get(FAMILY_REGULAR, 0) ; // Sans Serif Regular
}
-
+
public Font get(int family, int style) throws IOException {
Font font = (Font)fontMap.get( ( family << 8 ) | style );
if (font != null) {
@@ -97,7 +97,7 @@ public class UbuntuFontLoader implements FontSet {
font = abspath(availableFontFileNames[0], family, style);
}
break;
-
+
case FAMILY_LIGHT:
if( is(style, STYLE_ITALIC) ) {
font = abspath(availableFontFileNames[5], family, style);
@@ -105,19 +105,19 @@ public class UbuntuFontLoader implements FontSet {
font = abspath(availableFontFileNames[4], family, style);
}
break;
-
+
case FAMILY_MEDIUM:
if( is(style, STYLE_ITALIC) ) {
font = abspath(availableFontFileNames[6], family, style);
} else {
font = abspath(availableFontFileNames[7], family, style);
}
- break;
+ break;
}
return font;
}
-
+
Font abspath(String fname, int family, int style) throws IOException {
final String err = "Problem loading font "+fname+", stream "+relPath+fname;
try {
@@ -129,10 +129,10 @@ public class UbuntuFontLoader implements FontSet {
if(null != f) {
fontMap.put( ( family << 8 ) | style, f );
return f;
- }
+ }
throw new IOException(err);
} catch(IOException ioe) {
- throw new IOException(err, ioe);
+ throw new IOException(err, ioe);
}
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index 0441bf836..ba6c72650 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -51,20 +51,20 @@ import com.jogamp.opengl.math.geom.AABBox;
class TypecastFont implements FontInt {
static final boolean DEBUG = false;
-
+
final OTFontCollection fontset;
final OTFont font;
TypecastHMetrics metrics;
final CmapFormat cmapFormat;
int cmapentries;
-
- // FIXME: Add cache size to limit memory usage ??
- IntObjectHashMap char2Glyph;
+
+ // FIXME: Add cache size to limit memory usage ??
+ IntObjectHashMap char2Glyph;
public TypecastFont(OTFontCollection fontset) {
this.fontset = fontset;
this.font = fontset.getFont(0);
-
+
// FIXME: Generic attempt to find the best CmapTable,
// which is assumed to be the one with the most entries (stupid 'eh?)
CmapTable cmapTable = font.getCmapTable();
@@ -77,14 +77,14 @@ class TypecastFont implements FontInt {
int pidx = cmapIdxEntry.getPlatformId();
CmapFormat cf = cmapIdxEntry.getFormat();
if(DEBUG) {
- System.err.println("CmapFormat["+i+"]: platform " + pidx +
+ System.err.println("CmapFormat["+i+"]: platform " + pidx +
", encoding "+cmapIdxEntry.getEncodingId() + ": "+cf);
}
- if( _cmapFormatP[pidx] == null ||
+ if( _cmapFormatP[pidx] == null ||
_cmapFormatP[pidx].getLength() < cf.getLength() ) {
_cmapFormatP[pidx] = cf;
if( cf.getLength() > platformLength ) {
- platformLength = cf.getLength() ;
+ platformLength = cf.getLength() ;
platform = pidx;
encoding = cmapIdxEntry.getEncodingId();
}
@@ -93,10 +93,10 @@ class TypecastFont implements FontInt {
if(0 <= platform) {
cmapFormat = _cmapFormatP[platform];
if(DEBUG) {
- System.err.println("Selected CmapFormat: platform " + platform +
+ System.err.println("Selected CmapFormat: platform " + platform +
", encoding "+encoding + ": "+cmapFormat);
}
- } else {
+ } else {
CmapFormat _cmapFormat = null;
/*if(null == _cmapFormat) {
platform = ID.platformMacintosh;
@@ -127,14 +127,14 @@ class TypecastFont implements FontInt {
cmapentries = 0;
for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
CmapFormat.Range range = cmapFormat.getRange(i);
- cmapentries += range.getEndCode() - range.getStartCode() + 1; // end included
- }
+ cmapentries += range.getEndCode() - range.getStartCode() + 1; // end included
+ }
if(DEBUG) {
System.err.println("font direction hint: "+font.getHeadTable().getFontDirectionHint());
System.err.println("num glyphs: "+font.getNumGlyphs());
System.err.println("num cmap entries: "+cmapentries);
System.err.println("num cmap ranges: "+cmapFormat.getRangeCount());
-
+
for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
CmapFormat.Range range = cmapFormat.getRange(i);
for (int j = range.getStartCode(); j <= range.getEndCode(); ++j) {
@@ -147,7 +147,7 @@ class TypecastFont implements FontInt {
}
char2Glyph = new IntObjectHashMap(cmapentries + cmapentries/4);
}
-
+
public StringBuilder getName(StringBuilder sb, int nameIndex) {
return font.getName(nameIndex, sb);
}
@@ -161,12 +161,12 @@ class TypecastFont implements FontInt {
sb = getName(sb, Font.NAME_FAMILY).append("-");
getName(sb, Font.NAME_SUBFAMILY);
return sb;
- }
+ }
public float getAdvanceWidth(int i, float pixelSize) {
- return font.getHmtxTable().getAdvanceWidth(i) * metrics.getScale(pixelSize);
+ return font.getHmtxTable().getAdvanceWidth(i) * metrics.getScale(pixelSize);
}
-
+
public Metrics getMetrics() {
if (metrics == null) {
metrics = new TypecastHMetrics(this);
@@ -175,7 +175,7 @@ class TypecastFont implements FontInt {
}
public Glyph getGlyph(char symbol) {
- TypecastGlyph result = (TypecastGlyph) char2Glyph.get(symbol);
+ TypecastGlyph result = (TypecastGlyph) char2Glyph.get(symbol);
if (null == result) {
// final short code = (short) char2Code.get(symbol);
short code = (short) cmapFormat.mapCharCode(symbol);
@@ -187,7 +187,7 @@ class TypecastFont implements FontInt {
default: code = Glyph.ID_UNKNOWN;
}
}
-
+
jogamp.graph.font.typecast.ot.OTGlyph glyph = font.getGlyph(code);
if(null == glyph) {
glyph = font.getGlyph(Glyph.ID_UNKNOWN);
@@ -200,25 +200,25 @@ class TypecastFont implements FontInt {
if(DEBUG) {
System.err.println("New glyph: " + (int)symbol + " ( " + (char)symbol +" ) -> " + code + ", contours " + glyph.getPointCount() + ": " + path);
}
- final HdmxTable hdmx = font.getHdmxTable();
+ final HdmxTable hdmx = font.getHdmxTable();
if (null!= result && null != hdmx) {
/*if(DEBUG) {
System.err.println("hdmx "+hdmx);
}*/
for (int i=0; i getOutlineShapes(CharSequence string, float pixelSize, Factory extends Vertex> vertexFactory) {
AffineTransform transform = new AffineTransform(vertexFactory);
return TypecastRenderer.getOutlineShapes(this, string, pixelSize, transform, vertexFactory);
@@ -238,7 +238,7 @@ class TypecastFont implements FontInt {
}
}
- return (int)(width + 0.5f);
+ return (int)(width + 0.5f);
}
public float getStringHeight(CharSequence string, float pixelSize) {
@@ -254,7 +254,7 @@ class TypecastFont implements FontInt {
height = (int)Math.ceil(Math.max(bbox.getHeight(), height));
}
}
- return height;
+ return height;
}
public AABBox getStringBounds(CharSequence string, float pixelSize) {
@@ -284,17 +284,17 @@ class TypecastFont implements FontInt {
totalHeight -= advanceY;
totalWidth = Math.max(curLineWidth, totalWidth);
}
- return new AABBox(0, 0, 0, totalWidth, totalHeight,0);
+ return new AABBox(0, 0, 0, totalWidth, totalHeight,0);
}
final public int getNumGlyphs() {
return font.getNumGlyphs();
}
-
+
public boolean isPrintableChar( char c ) {
return FontFactory.isPrintableChar(c);
}
-
+
public String toString() {
return getFullFamilyName(null).toString();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
index 8479c08ca..77b5a9aa9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
@@ -46,7 +46,7 @@ public class TypecastFontConstructor implements FontConstructor {
public Font create(final File ffile) throws IOException {
Object o = AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
- OTFontCollection fontset;
+ OTFontCollection fontset;
try {
fontset = OTFontCollection.create(ffile);
return new TypecastFont(fontset);
@@ -63,14 +63,14 @@ public class TypecastFontConstructor implements FontConstructor {
}
throw new InternalError("Unexpected Object: "+o);
}
-
+
public Font create(final URLConnection fconn) throws IOException {
return AccessController.doPrivileged(new PrivilegedAction() {
public Font run() {
File tf = null;
int len=0;
Font f = null;
- try {
+ try {
tf = IOUtil.createTempFile( "jogl.font", ".ttf", false);
len = IOUtil.copyURLConn2File(fconn, tf);
if(len==0) {
@@ -84,7 +84,7 @@ public class TypecastFontConstructor implements FontConstructor {
}
return f;
}
- });
+ });
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
index 1205c6539..476b3fd4e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
@@ -40,45 +40,45 @@ public class TypecastGlyph implements FontInt.GlyphInt {
public class Advance
{
final Font font;
- final float advance;
- HashMap size2advance = new HashMap();
-
+ final float advance;
+ HashMap size2advance = new HashMap();
+
public Advance(Font font, float advance)
{
this.font = font;
this.advance = advance;
}
-
+
public void reset() {
size2advance.clear();
}
-
+
public float getScale(float pixelSize)
{
return this.font.getMetrics().getScale(pixelSize);
}
-
+
public void add(float advance, float size)
{
size2advance.put(size, advance);
}
-
+
public float get(float size, boolean useFrationalMetrics)
{
Float fo = size2advance.get(size);
- if(null == fo) {
+ if(null == fo) {
float value = (this.advance * getScale(size));
if (useFrationalMetrics == false) {
//value = (float)Math.ceil(value);
// value = (int)value;
- value = (int) ( value + 0.5f ) ; // TODO: check
+ value = (int) ( value + 0.5f ) ; // TODO: check
}
size2advance.put(size, value);
return value;
}
return fo.floatValue();
}
-
+
public String toString()
{
return "\nAdvance:"+
@@ -86,147 +86,147 @@ public class TypecastGlyph implements FontInt.GlyphInt {
"\n advances: \n"+size2advance;
}
}
-
+
public class Metrics
{
AABBox bbox;
Advance advance;
-
+
public Metrics(Font font, AABBox bbox, float advance)
{
this.bbox = bbox;
this.advance = new Advance(font, advance);
}
-
+
public void reset() {
advance.reset();
}
-
+
public float getScale(float pixelSize)
{
return this.advance.getScale(pixelSize);
}
-
+
public AABBox getBBox()
{
return this.bbox;
}
-
+
public void addAdvance(float advance, float size)
{
this.advance.add(advance, size);
}
-
+
public float getAdvance(float size, boolean useFrationalMetrics)
{
return this.advance.get(size, useFrationalMetrics);
}
-
+
public String toString()
{
return "\nMetrics:"+
"\n bbox: "+this.bbox+
this.advance;
}
- }
+ }
public static final short INVALID_ID = (short)((1 << 16) - 1);
public static final short MAX_ID = (short)((1 << 16) - 2);
-
+
private final Font font;
-
+
char symbol;
short id;
int advance;
Metrics metrics;
-
+
protected Path2D path; // in EM units
protected Path2D pathSized;
protected float numberSized;
-
+
protected TypecastGlyph(Font font, char symbol) {
this.font = font;
this.symbol = symbol;
}
-
+
protected TypecastGlyph(Font font,
char symbol, short id, AABBox bbox, int advance, Path2D path) {
this.font = font;
this.symbol = symbol;
this.advance = advance;
-
+
init(id, bbox, advance);
-
+
this.path = path;
this.pathSized = null;
this.numberSized = 0.0f;
}
-
+
void init(short id, AABBox bbox, int advance) {
this.id = id;
this.advance = advance;
this.metrics = new Metrics(this.font, bbox, this.advance);
}
-
+
public void reset(Path2D path) {
this.path = path;
this.metrics.reset();
}
-
+
public Font getFont() {
return this.font;
}
-
+
public char getSymbol() {
return this.symbol;
}
-
+
AABBox getBBoxUnsized() {
return this.metrics.getBBox();
}
-
+
public AABBox getBBox() {
return this.metrics.getBBox();
}
-
+
public Metrics getMetrics() {
return this.metrics;
}
-
+
public short getID() {
return this.id;
}
-
+
public float getScale(float pixelSize) {
return this.metrics.getScale(pixelSize);
}
-
+
public AABBox getBBox(float pixelSize) {
final float size = getScale(pixelSize);
AABBox newBox = getBBox().clone();
newBox.scale(size);
- return newBox;
+ return newBox;
}
-
+
protected void addAdvance(float advance, float size) {
this.metrics.addAdvance(advance, size);
}
-
+
public float getAdvance(float pixelSize, boolean useFrationalMetrics) {
return this.metrics.getAdvance(pixelSize, useFrationalMetrics);
}
-
+
public Path2D getPath() {
return this.path;
}
-
+
public Path2D getPath(float pixelSize) {
final float size = getScale(pixelSize);
-
+
if (this.numberSized != size) {
this.numberSized = size;
this.pathSized = AffineTransform.getScaleInstance(null, size, size).createTransformedShape(getPath());
- }
+ }
return this.pathSized;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
index f170f5819..a6ce58ae2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
@@ -35,7 +35,7 @@ import com.jogamp.opengl.math.geom.AABBox;
class TypecastHMetrics implements Metrics {
private final TypecastFont fontImpl;
-
+
// HeadTable
private final HeadTable headTable;
private final float unitsPerEM_Inv;
@@ -44,23 +44,23 @@ class TypecastHMetrics implements Metrics {
private final HheaTable hheaTable;
// VheaTable (for horizontal fonts)
// private final VheaTable vheaTable;
-
+
public TypecastHMetrics(TypecastFont fontImpl) {
this.fontImpl = fontImpl;
headTable = this.fontImpl.font.getHeadTable();
- hheaTable = this.fontImpl.font.getHheaTable();
+ hheaTable = this.fontImpl.font.getHheaTable();
// vheaTable = this.fontImpl.font.getVheaTable();
unitsPerEM_Inv = 1.0f / ( (float) headTable.getUnitsPerEm() );
-
+
int maxWidth = headTable.getXMax() - headTable.getXMin();
- int maxHeight = headTable.getYMax() - headTable.getYMin();
+ int maxHeight = headTable.getYMax() - headTable.getYMin();
float lowx= headTable.getXMin();
float lowy = -(headTable.getYMin()+maxHeight);
float highx = lowx + maxWidth;
float highy = lowy + maxHeight;
bbox = new AABBox(lowx, lowy, 0, highx, highy, 0); // invert
}
-
+
public final float getAscent(float pixelSize) {
return getScale(pixelSize) * -hheaTable.getAscender(); // invert
}
@@ -78,7 +78,7 @@ class TypecastHMetrics implements Metrics {
}
public final AABBox getBBox(float pixelSize) {
AABBox res = new AABBox(bbox.getLow(), bbox.getHigh());
- res.scale(getScale(pixelSize));
+ res.scale(getScale(pixelSize));
return res;
}
}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
index f155345aa..127e260ca 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
@@ -43,14 +43,14 @@ import com.jogamp.graph.geom.Vertex;
import com.jogamp.graph.geom.Vertex.Factory;
/**
- * Factory to build a {@link com.jogamp.graph.geom.Path2D Path2D} from
- * {@link jogamp.graph.font.typecast.ot.OTGlyph Glyph}s.
+ * Factory to build a {@link com.jogamp.graph.geom.Path2D Path2D} from
+ * {@link jogamp.graph.font.typecast.ot.OTGlyph Glyph}s.
*/
public class TypecastRenderer {
- private static void getPaths(TypecastFont font,
+ private static void getPaths(TypecastFont font,
CharSequence string, float pixelSize, AffineTransform transform, Path2D[] p)
- {
+ {
if (string == null) {
return;
}
@@ -79,14 +79,14 @@ public class TypecastRenderer {
} else if (character == ' ') {
advanceTotal += font.getAdvanceWidth(Glyph.ID_SPACE, pixelSize);
continue;
- }
+ }
Glyph glyph = font.getGlyph(character);
Path2D gp = ((GlyphInt)glyph).getPath();
float scale = metrics.getScale(pixelSize);
t.translate(advanceTotal, y);
t.scale(scale, scale);
p[i].append(gp.iterator(t), false);
- advanceTotal += glyph.getAdvance(pixelSize, true);
+ advanceTotal += glyph.getAdvance(pixelSize, true);
}
}
@@ -119,19 +119,19 @@ public class TypecastRenderer {
case PathIterator.SEG_MOVETO:
shape.closeLastOutline();
shape.addEmptyOutline();
- shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
+ shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
break;
case PathIterator.SEG_LINETO:
- shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
+ shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
break;
case PathIterator.SEG_QUADTO:
shape.addVertex(0, vertexFactory.create(coords, 0, 2, false));
- shape.addVertex(0, vertexFactory.create(coords, 2, 2, true));
+ shape.addVertex(0, vertexFactory.create(coords, 2, 2, true));
break;
case PathIterator.SEG_CUBICTO:
shape.addVertex(0, vertexFactory.create(coords, 0, 2, false));
shape.addVertex(0, vertexFactory.create(coords, 2, 2, false));
- shape.addVertex(0, vertexFactory.create(coords, 4, 2, true));
+ shape.addVertex(0, vertexFactory.create(coords, 4, 2, true));
break;
case PathIterator.SEG_CLOSE:
shape.closeLastOutline();
@@ -184,12 +184,12 @@ public class TypecastRenderer {
if (point_plus1.onCurve) {
// s = new Line2D.Float(point.x, point.y, point_plus1.x, point_plus1.y);
gp.lineTo( point_plus1.x, point_plus1.y );
- offset++;
+ offset++;
} else {
if (point_plus2.onCurve) {
// s = new QuadCurve2D.Float( point.x, point.y, point_plus1.x, point_plus1.y, point_plus2.x, point_plus2.y);
gp.quadTo(point_plus1.x, point_plus1.y, point_plus2.x, point_plus2.y);
- offset+=2;
+ offset+=2;
} else {
// s = new QuadCurve2D.Float(point.x,point.y,point_plus1.x,point_plus1.y,
// midValue(point_plus1.x, point_plus2.x), midValue(point_plus1.y, point_plus2.y));
@@ -210,7 +210,7 @@ public class TypecastRenderer {
// midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y));
//gp.curve3(midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y), point.x, point.y);
gp.quadTo(point.x, point.y, midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y));
- offset++;
+ offset++;
}
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
index b5535758d..8b685659e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
index ece0aae4b..0a4786f82 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
@@ -840,11 +840,11 @@ public class Fixed {
}
return n;
}
-
+
public static float floatValue(long fixed) {
return (fixed >> 16) + (float)(fixed & 0xffff) / 0x10000;
}
-
+
public static float roundedFloatValue(long fixed, int decimalPlaces) {
int factor = 10 * decimalPlaces;
return (float)((int)(floatValue(fixed) * factor)) / factor;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
index 6b3dc1f6f..d6c9da268 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
index 8c14b7302..8fc4be92d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
@@ -104,10 +104,10 @@ public class OTFont {
public StringBuilder getName(int nameIndex, StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
- }
+ }
return _name.getRecordsRecordString(sb, nameIndex);
}
-
+
public StringBuilder getAllNames(StringBuilder sb, String separator) {
if(null != _name) {
if(null == sb) {
@@ -117,9 +117,9 @@ public class OTFont {
_name.getRecord(i).getRecordString(sb).append(separator);
}
}
- return sb;
+ return sb;
}
-
+
public Table getTable(int tableType) {
for (int i = 0; i < _tables.length; i++) {
if ((_tables[i] != null) && (_tables[i].getType() == tableType)) {
@@ -132,31 +132,31 @@ public class OTFont {
public Os2Table getOS2Table() {
return _os2;
}
-
+
public CmapTable getCmapTable() {
return _cmap;
}
-
+
public HeadTable getHeadTable() {
return _head;
}
-
+
public HheaTable getHheaTable() {
return _hhea;
}
-
+
public HdmxTable getHdmxTable() {
return _hdmx;
}
-
+
public HmtxTable getHmtxTable() {
return _hmtx;
}
-
+
public LocaTable getLocaTable() {
return _loca;
}
-
+
public MaxpTable getMaxpTable() {
return _maxp;
}
@@ -186,8 +186,8 @@ public class OTFont {
}
public OTGlyph getGlyph(int i) {
-
- final GlyfDescript _glyfDescr = _glyf.getDescription(i);
+
+ final GlyfDescript _glyfDescr = _glyf.getDescription(i);
return (null != _glyfDescr)
? new OTGlyph(
_glyfDescr,
@@ -195,11 +195,11 @@ public class OTFont {
_hmtx.getAdvanceWidth(i))
: null;
}
-
+
public TableDirectory getTableDirectory() {
return _tableDirectory;
}
-
+
private Table readTable(
DataInputStream dis,
int tablesOrigin,
@@ -228,13 +228,13 @@ public class OTFont {
DataInputStream dis,
int directoryOffset,
int tablesOrigin) throws IOException {
-
+
// Load the table directory
dis.reset();
dis.skip(directoryOffset);
_tableDirectory = new TableDirectory(dis);
_tables = new Table[_tableDirectory.getNumTables()];
-
+
// Load some prerequisite tables
_head = (HeadTable) readTable(dis, tablesOrigin, Table.head);
_hhea = (HheaTable) readTable(dis, tablesOrigin, Table.hhea);
@@ -252,7 +252,7 @@ public class OTFont {
if (_vhea != null) {
_tables[index++] = _vhea;
}
-
+
// Load all other tables
for (int i = 0; i < _tableDirectory.getNumTables(); i++) {
DirectoryEntry entry = _tableDirectory.getEntry(i);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
index 4a041604d..c79380f16 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
@@ -75,11 +75,11 @@ public class OTFontCollection {
public OTFont getFont(int i) {
return _fonts[i];
}
-
+
public int getFontCount() {
return _fonts.length;
}
-
+
public TTCHeader getTtcHeader() {
return _ttcHeader;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
index 244ab400a..e0d652bd4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
@@ -102,10 +102,10 @@ public class OTGlyph {
}
}
- public AABBox getBBox() {
- return _bbox;
+ public AABBox getBBox() {
+ return _bbox;
}
-
+
public int getAdvanceWidth() {
return _advanceWidth;
}
@@ -163,7 +163,7 @@ public class OTGlyph {
// Append the origin and advanceWidth points (n & n+1)
// _points[gd.getPointCount()] = new Point(0, 0, true, true);
// _points[gd.getPointCount()+1] = new Point(_advanceWidth, 0, true, true);
-
+
_bbox = new AABBox(gd.getXMinimum(), gd.getYMinimum(), 0, gd.getXMaximum(), gd.getYMaximum(), 0);
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
index 433ff6051..7a5b0c4d2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
@@ -31,7 +31,7 @@ import java.io.IOException;
public class ResourceData {
private byte[] data;
-
+
/** Creates new ResourceData */
public ResourceData(DataInput di) throws IOException {
int dataLen = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
index 2ada22c82..468ab2e1c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
@@ -33,14 +33,14 @@ public class ResourceFile {
private ResourceHeader header;
private ResourceMap map;
-
+
/** Creates new Resource */
public ResourceFile(RandomAccessFile raf) throws IOException {
// Read header at the beginning of the file
raf.seek(0);
header = new ResourceHeader(raf);
-
+
// Seek to the map offset and read the map
raf.seek(header.getMapOffset());
map = new ResourceMap(raf);
@@ -53,18 +53,18 @@ public class ResourceFile {
public static void main(String[] args) {
try {
//RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/GillSans.dfont", "r");
-
+
// Tests loading a font from a resource fork on Mac OS X
RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/Georgia/..namedfork/rsrc", "r");
ResourceFile resource = new ResourceFile(raf);
for (int i = 0; i < resource.getResourceMap().getResourceTypeCount(); i++) {
System.out.println(resource.getResourceMap().getResourceType(i).getTypeAsString());
}
-
+
// Get the first 'sfnt' resource
ResourceType type = resource.getResourceMap().getResourceType("sfnt");
ResourceReference reference = type.getReference(0);
-
+
type = resource.getResourceMap().getResourceType("FOND");
for (int i = 0; i < type.getCount(); ++i) {
reference = type.getReference(i);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
index 8f5224632..de13b116f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
@@ -46,15 +46,15 @@ public class ResourceHeader {
public int getDataOffset() {
return dataOffset;
}
-
+
public int getMapOffset() {
return mapOffset;
}
-
+
public int getDataLength() {
return dataLen;
}
-
+
public int getMapLength() {
return mapLen;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
index 96ba06087..d348c645e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
@@ -35,7 +35,7 @@ public class ResourceMap {
private int fileReferenceNumber;
private int attributes;
private ResourceType[] types;
-
+
/** Creates new ResourceMap */
public ResourceMap(DataInput di) throws IOException {
di.readFully(headerCopy);
@@ -45,18 +45,18 @@ public class ResourceMap {
int typeOffset = di.readUnsignedShort();
int nameOffset = di.readUnsignedShort();
int typeCount = di.readUnsignedShort() + 1;
-
+
// Read types
types = new ResourceType[typeCount];
for (int i = 0; i < typeCount; i++) {
types[i] = new ResourceType(di);
}
-
+
// Read the references
for (int i = 0; i < typeCount; i++) {
types[i].readRefs(di);
}
-
+
// Read the names
for (int i = 0; i < typeCount; i++) {
types[i].readNames(di);
@@ -76,7 +76,7 @@ public class ResourceMap {
public ResourceType getResourceType(int i) {
return types[i];
}
-
+
public int getResourceTypeCount() {
return types.length;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
index fd7ec46b2..9d1534821 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
@@ -36,7 +36,7 @@ public class ResourceReference {
private int dataOffset;
private int handle;
private String name;
-
+
/** Creates new ResourceReference */
protected ResourceReference(DataInput di) throws IOException {
id = di.readUnsignedShort();
@@ -58,23 +58,23 @@ public class ResourceReference {
public int getId() {
return id;
}
-
+
public short getNameOffset() {
return nameOffset;
}
-
+
public short getAttributes() {
return attributes;
}
-
+
public int getDataOffset() {
return dataOffset;
}
-
+
public int getHandle() {
return handle;
}
-
+
public String getName() {
return name;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
index 1c7e24c0f..2ad002e6a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
@@ -34,7 +34,7 @@ public class ResourceType {
private int count;
private int offset;
private ResourceReference[] references;
-
+
/** Creates new ResourceType */
protected ResourceType(DataInput di) throws IOException {
type = di.readInt();
@@ -42,7 +42,7 @@ public class ResourceType {
offset = di.readUnsignedShort();
references = new ResourceReference[count];
}
-
+
protected void readRefs(DataInput di) throws IOException {
for (int i = 0; i < count; i++) {
references[i] = new ResourceReference(di);
@@ -58,7 +58,7 @@ public class ResourceType {
public int getType() {
return type;
}
-
+
public String getTypeAsString() {
return new StringBuilder()
.append((char)((type>>24)&0xff))
@@ -67,11 +67,11 @@ public class ResourceType {
.append((char)((type)&0xff))
.toString();
}
-
+
public int getCount() {
return count;
}
-
+
public int getOffset() {
return offset;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
index ed615eb72..b6626a9cc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
@@ -31,18 +31,18 @@ import java.io.IOException;
* @author David Schweinsberg
*/
public class BaseTable implements Table {
-
+
private abstract class BaseCoord {
public abstract int getBaseCoordFormat();
-
+
public abstract short getCoordinate();
}
-
+
private class BaseCoordFormat1 extends BaseCoord {
private short _coordinate;
-
+
protected BaseCoordFormat1(DataInput di) throws IOException {
_coordinate = di.readShort();
}
@@ -50,19 +50,19 @@ public class BaseTable implements Table {
public int getBaseCoordFormat() {
return 1;
}
-
+
public short getCoordinate() {
return _coordinate;
}
-
+
}
-
+
private class BaseCoordFormat2 extends BaseCoord {
private short _coordinate;
private int _referenceGlyph;
private int _baseCoordPoint;
-
+
protected BaseCoordFormat2(DataInput di) throws IOException {
_coordinate = di.readShort();
_referenceGlyph = di.readUnsignedShort();
@@ -72,18 +72,18 @@ public class BaseTable implements Table {
public int getBaseCoordFormat() {
return 2;
}
-
+
public short getCoordinate() {
return _coordinate;
}
-
+
}
-
+
private class BaseCoordFormat3 extends BaseCoord {
private short _coordinate;
private int _deviceTableOffset;
-
+
protected BaseCoordFormat3(DataInput di) throws IOException {
_coordinate = di.readShort();
_deviceTableOffset = di.readUnsignedShort();
@@ -92,33 +92,33 @@ public class BaseTable implements Table {
public int getBaseCoordFormat() {
return 2;
}
-
+
public short getCoordinate() {
return _coordinate;
}
-
+
}
-
+
private class FeatMinMaxRecord {
-
+
private int _tag;
private int _minCoordOffset;
private int _maxCoordOffset;
-
+
protected FeatMinMaxRecord(DataInput di) throws IOException {
_tag = di.readInt();
_minCoordOffset = di.readUnsignedShort();
_maxCoordOffset = di.readUnsignedShort();
}
}
-
+
private class MinMax {
-
+
private int _minCoordOffset;
private int _maxCoordOffset;
private int _featMinMaxCount;
private FeatMinMaxRecord[] _featMinMaxRecord;
-
+
protected MinMax(int minMaxOffset) throws IOException {
DataInput di = getDataInputForOffset(minMaxOffset);
_minCoordOffset = di.readUnsignedShort();
@@ -130,14 +130,14 @@ public class BaseTable implements Table {
}
}
}
-
+
private class BaseValues {
-
+
private int _defaultIndex;
private int _baseCoordCount;
private int[] _baseCoordOffset;
private BaseCoord[] _baseCoords;
-
+
protected BaseValues(int baseValuesOffset) throws IOException {
DataInput di = getDataInputForOffset(baseValuesOffset);
_defaultIndex = di.readUnsignedShort();
@@ -163,12 +163,12 @@ public class BaseTable implements Table {
}
}
}
-
+
private class BaseLangSysRecord {
-
+
private int _baseLangSysTag;
private int _minMaxOffset;
-
+
protected BaseLangSysRecord(DataInput di) throws IOException {
_baseLangSysTag = di.readInt();
_minMaxOffset = di.readUnsignedShort();
@@ -177,14 +177,14 @@ public class BaseTable implements Table {
public int getBaseLangSysTag() {
return _baseLangSysTag;
}
-
+
public int getMinMaxOffset() {
return _minMaxOffset;
}
}
-
+
private class BaseScript {
-
+
private int _thisOffset;
private int _baseValuesOffset;
private int _defaultMinMaxOffset;
@@ -192,7 +192,7 @@ public class BaseTable implements Table {
private BaseLangSysRecord[] _baseLangSysRecord;
private BaseValues _baseValues;
private MinMax[] _minMax;
-
+
protected BaseScript(int baseScriptOffset) throws IOException {
_thisOffset = baseScriptOffset;
DataInput di = getDataInputForOffset(baseScriptOffset);
@@ -231,9 +231,9 @@ public class BaseTable implements Table {
return sb.toString();
}
}
-
+
private class BaseScriptRecord {
-
+
private int _baseScriptTag;
private int _baseScriptOffset;
@@ -245,19 +245,19 @@ public class BaseTable implements Table {
public int getBaseScriptTag() {
return _baseScriptTag;
}
-
+
public int getBaseScriptOffset() {
return _baseScriptOffset;
}
}
-
+
private class BaseScriptList {
-
+
private int _thisOffset;
private int _baseScriptCount;
private BaseScriptRecord[] _baseScriptRecord;
private BaseScript[] _baseScripts;
-
+
protected BaseScriptList(int baseScriptListOffset) throws IOException {
_thisOffset = baseScriptListOffset;
DataInput di = getDataInputForOffset(baseScriptListOffset);
@@ -288,13 +288,13 @@ public class BaseTable implements Table {
return sb.toString();
}
}
-
+
private class BaseTagList {
-
+
private int _thisOffset;
private int _baseTagCount;
private int[] _baselineTag;
-
+
protected BaseTagList(int baseTagListOffset) throws IOException {
_thisOffset = baseTagListOffset;
DataInput di = getDataInputForOffset(baseTagListOffset);
@@ -315,9 +315,9 @@ public class BaseTable implements Table {
return sb.toString();
}
}
-
+
private class Axis {
-
+
private int _thisOffset;
private int _baseTagListOffset;
private int _baseScriptListOffset;
@@ -348,7 +348,7 @@ public class BaseTable implements Table {
.toString();
}
}
-
+
private DirectoryEntry _de;
private int _version;
private int _horizAxisOffset;
@@ -375,25 +375,25 @@ public class BaseTable implements Table {
if (_vertAxisOffset != 0) {
_vertAxis = new Axis(_vertAxisOffset);
}
-
+
// Let go of the buffer
_buf = null;
}
-
+
private DataInput getDataInputForOffset(int offset) {
return new DataInputStream(new ByteArrayInputStream(
_buf, offset,
_de.getLength() - offset));
}
-
+
// private String valueAsShortHex(int value) {
// return String.format("%1$4x", value);
// }
-//
+//
// private String valueAsLongHex(int value) {
// return String.format("%1$8x", value);
// }
-
+
static protected String tagAsString(int tag) {
char[] c = new char[4];
c[0] = (char)((tag >> 24) & 0xff);
@@ -402,7 +402,7 @@ public class BaseTable implements Table {
c[3] = (char)(tag & 0xff);
return String.valueOf(c);
}
-
+
public int getType() {
return BASE;
}
@@ -422,7 +422,7 @@ public class BaseTable implements Table {
}
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
index 966f6e17b..62486fb7f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
@@ -36,13 +36,13 @@ import java.util.Hashtable;
* @author David Schweinsberg
*/
public class CffTable implements Table {
-
+
public class Dict {
-
+
private Dictionary _entries = new Hashtable();
private int[] _data;
private int _index;
-
+
protected Dict(int[] data, int offset, int length) {
_data = data;
_index = offset;
@@ -50,11 +50,11 @@ public class CffTable implements Table {
addKeyAndValueEntry();
}
}
-
+
public Object getValue(int key) {
return _entries.get(key);
}
-
+
private boolean addKeyAndValueEntry() {
ArrayList operands = new ArrayList();
Object operand = null;
@@ -74,7 +74,7 @@ public class CffTable implements Table {
}
return true;
}
-
+
private boolean isOperandAtIndex() {
int b0 = _data[_index];
if ((32 <= b0 && b0 <= 254)
@@ -97,31 +97,31 @@ public class CffTable implements Table {
private Object nextOperand() {
int b0 = _data[_index];
if (32 <= b0 && b0 <= 246) {
-
+
// 1 byte integer
++_index;
return new Integer(b0 - 139);
} else if (247 <= b0 && b0 <= 250) {
-
+
// 2 byte integer
int b1 = _data[_index + 1];
_index += 2;
return new Integer((b0 - 247) * 256 + b1 + 108);
} else if (251 <= b0 && b0 <= 254) {
-
+
// 2 byte integer
int b1 = _data[_index + 1];
_index += 2;
return new Integer(-(b0 - 251) * 256 - b1 - 108);
} else if (b0 == 28) {
-
+
// 3 byte integer
int b1 = _data[_index + 1];
int b2 = _data[_index + 2];
_index += 3;
return new Integer(b1 << 8 | b2);
} else if (b0 == 29) {
-
+
// 5 byte integer
int b1 = _data[_index + 1];
int b2 = _data[_index + 2];
@@ -130,7 +130,7 @@ public class CffTable implements Table {
_index += 5;
return new Integer(b1 << 24 | b2 << 16 | b3 << 8 | b4);
} else if (b0 == 30) {
-
+
// Real number
StringBuilder fString = new StringBuilder();
int nibble1 = 0;
@@ -142,13 +142,13 @@ public class CffTable implements Table {
++_index;
fString.append(decodeRealNibble(nibble1));
fString.append(decodeRealNibble(nibble2));
- }
+ }
return new Float(fString.toString());
} else {
return null;
}
}
-
+
private String decodeRealNibble(int nibble) {
if (nibble < 0xa) {
return Integer.toString(nibble);
@@ -163,7 +163,7 @@ public class CffTable implements Table {
}
return "";
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder();
Enumeration keys = _entries.keys();
@@ -179,14 +179,14 @@ public class CffTable implements Table {
return sb.toString();
}
}
-
+
public class Index {
-
+
private int _count;
private int _offSize;
private int[] _offset;
private int[] _data;
-
+
protected Index(DataInput di) throws IOException {
_count = di.readUnsignedShort();
_offset = new int[_count + 1];
@@ -203,19 +203,19 @@ public class CffTable implements Table {
_data[i] = di.readUnsignedByte();
}
}
-
+
public int getCount() {
return _count;
}
-
+
public int getOffset(int index) {
return _offset[index];
}
-
+
public int getDataLength() {
return _offset[_offset.length - 1] - 1;
}
-
+
public int[] getData() {
return _data;
}
@@ -241,13 +241,13 @@ public class CffTable implements Table {
return sb.toString();
}
}
-
+
public class TopDictIndex extends Index {
protected TopDictIndex(DataInput di) throws IOException {
super(di);
}
-
+
public Dict getTopDict(int index) {
int offset = getOffset(index) - 1;
int len = getOffset(index + 1) - offset - 1;
@@ -262,13 +262,13 @@ public class CffTable implements Table {
return sb.toString();
}
}
-
+
public class NameIndex extends Index {
protected NameIndex(DataInput di) throws IOException {
super(di);
}
-
+
public String getName(int index) {
String name = null;
int offset = getOffset(index) - 1;
@@ -286,7 +286,7 @@ public class CffTable implements Table {
}
return name;
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < getCount(); ++i) {
@@ -301,7 +301,7 @@ public class CffTable implements Table {
protected StringIndex(DataInput di) throws IOException {
super(di);
}
-
+
public String getString(int index) {
if (index < CffStandardStrings.standardStrings.length) {
return CffStandardStrings.standardStrings[index];
@@ -320,7 +320,7 @@ public class CffTable implements Table {
return sb.toString();
}
}
-
+
public String toString() {
int nonStandardBase = CffStandardStrings.standardStrings.length;
StringBuilder sb = new StringBuilder();
@@ -331,12 +331,12 @@ public class CffTable implements Table {
return sb.toString();
}
}
-
+
private class CharsetRange {
-
+
private int _first;
private int _left;
-
+
public int getFirst() {
return _first;
}
@@ -344,7 +344,7 @@ public class CffTable implements Table {
protected void setFirst(int first) {
_first = first;
}
-
+
public int getLeft() {
return _left;
}
@@ -355,39 +355,39 @@ public class CffTable implements Table {
}
private class CharsetRange1 extends CharsetRange {
-
+
protected CharsetRange1(DataInput di) throws IOException {
setFirst(di.readUnsignedShort());
setLeft(di.readUnsignedByte());
}
}
-
+
private class CharsetRange2 extends CharsetRange {
-
+
protected CharsetRange2(DataInput di) throws IOException {
setFirst(di.readUnsignedShort());
setLeft(di.readUnsignedShort());
}
}
-
+
private abstract class Charset {
-
+
public abstract int getFormat();
-
+
public abstract int getSID(int gid);
}
-
+
private class CharsetFormat0 extends Charset {
-
+
private int[] _glyph;
-
+
protected CharsetFormat0(DataInput di, int glyphCount) throws IOException {
_glyph = new int[glyphCount - 1]; // minus 1 because .notdef is omitted
for (int i = 0; i < glyphCount - 1; ++i) {
_glyph[i] = di.readUnsignedShort();
}
}
-
+
public int getFormat() {
return 0;
}
@@ -399,11 +399,11 @@ public class CffTable implements Table {
return _glyph[gid - 1];
}
}
-
+
private class CharsetFormat1 extends Charset {
-
+
private ArrayList _charsetRanges = new ArrayList();
-
+
protected CharsetFormat1(DataInput di, int glyphCount) throws IOException {
int glyphsCovered = glyphCount - 1; // minus 1 because .notdef is omitted
while (glyphsCovered > 0) {
@@ -421,7 +421,7 @@ public class CffTable implements Table {
if (gid == 0) {
return 0;
}
-
+
// Count through the ranges to find the one of interest
int count = 0;
for (CharsetRange range : _charsetRanges) {
@@ -436,9 +436,9 @@ public class CffTable implements Table {
}
private class CharsetFormat2 extends Charset {
-
+
private ArrayList _charsetRanges = new ArrayList();
-
+
protected CharsetFormat2(DataInput di, int glyphCount) throws IOException {
int glyphsCovered = glyphCount - 1; // minus 1 because .notdef is omitted
while (glyphsCovered > 0) {
@@ -456,7 +456,7 @@ public class CffTable implements Table {
if (gid == 0) {
return 0;
}
-
+
// Count through the ranges to find the one of interest
int count = 0;
for (CharsetRange range : _charsetRanges) {
@@ -469,7 +469,7 @@ public class CffTable implements Table {
return 0;
}
}
-
+
private DirectoryEntry _de;
private int _major;
private int _minor;
@@ -499,24 +499,24 @@ public class CffTable implements Table {
_minor = di2.readUnsignedByte();
_hdrSize = di2.readUnsignedByte();
_offSize = di2.readUnsignedByte();
-
+
// Name INDEX
di2 = getDataInputForOffset(_hdrSize);
_nameIndex = new NameIndex(di2);
-
+
// Top DICT INDEX
_topDictIndex = new TopDictIndex(di2);
// String INDEX
_stringIndex = new StringIndex(di2);
-
+
// Global Subr INDEX
_globalSubrIndex = new Index(di2);
-
+
// Encodings go here -- but since this is an OpenType font will this
// not always be a CIDFont? In which case there are no encodings
// within the CFF data.
-
+
// Load each of the fonts
_charStringsIndexArray = new Index[_topDictIndex.getCount()];
_charsets = new Charset[_topDictIndex.getCount()];
@@ -530,7 +530,7 @@ public class CffTable implements Table {
di2 = getDataInputForOffset(charStringsOffset);
_charStringsIndexArray[i] = new Index(di2);
int glyphCount = _charStringsIndexArray[i].getCount();
-
+
// Charsets
Integer charsetOffset = (Integer) _topDictIndex.getTopDict(i).getValue(15);
di2 = getDataInputForOffset(charsetOffset);
@@ -563,7 +563,7 @@ public class CffTable implements Table {
}
}
}
-
+
private DataInput getDataInputForOffset(int offset) {
return new DataInputStream(new ByteArrayInputStream(
_buf, offset,
@@ -573,7 +573,7 @@ public class CffTable implements Table {
public NameIndex getNameIndex() {
return _nameIndex;
}
-
+
public Charset getCharset(int fontIndex) {
return _charsets[fontIndex];
}
@@ -581,7 +581,7 @@ public class CffTable implements Table {
public Charstring getCharstring(int fontIndex, int gid) {
return _charstringsArray[fontIndex][gid];
}
-
+
public int getCharstringCount(int fontIndex) {
return _charstringsArray[fontIndex].length;
}
@@ -607,7 +607,7 @@ public class CffTable implements Table {
}
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Charstring.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Charstring.java
index d411d1e00..01e2d4934 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Charstring.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Charstring.java
@@ -28,6 +28,6 @@ package jogamp.graph.font.typecast.ot.table;
public abstract class Charstring {
public abstract int getIndex();
-
+
public abstract String getName();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
index 9c40a0e5e..93ff60988 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
@@ -28,7 +28,7 @@ import jogamp.graph.font.typecast.ot.table.CffTable;
* @author David Schweinsberg
*/
public class CharstringType2 extends Charstring {
-
+
private static final String[] _oneByteOperators = {
"-Reserved-",
"hstem",
@@ -105,7 +105,7 @@ public class CharstringType2 extends Charstring {
"flex1",
"-Reserved-"
};
-
+
private int _index;
private String _name;
private int[] _data;
@@ -132,7 +132,7 @@ public class CharstringType2 extends Charstring {
_localSubrIndex = localSubrIndex;
_globalSubrIndex = globalSubrIndex;
}
-
+
public int getIndex() {
return _index;
}
@@ -140,7 +140,7 @@ public class CharstringType2 extends Charstring {
public String getName() {
return _name;
}
-
+
private void disassemble(StringBuilder sb) {
Number operand = null;
while (isOperandAtIndex()) {
@@ -151,7 +151,7 @@ public class CharstringType2 extends Charstring {
String mnemonic;
if (operator == 12) {
operator = nextByte();
-
+
// Check we're not exceeding the upper limit of our mnemonics
if (operator > 38) {
operator = 38;
@@ -162,7 +162,7 @@ public class CharstringType2 extends Charstring {
}
sb.append(mnemonic);
}
-
+
public void resetIP() {
_ip = _offset;
}
@@ -214,15 +214,15 @@ public class CharstringType2 extends Charstring {
return null;
}
}
-
+
public int nextByte() {
return _data[_ip++];
}
-
+
public boolean moreBytes() {
return _ip < _offset + _length;
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder();
resetIP();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
index 4c2f3decb..21698c76b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
index 0c99ad66a..1079aeed4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
index 5b7c4d655..59bc7b329 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
index 7ce531cd9..62ce5ae4c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
@@ -58,21 +58,21 @@ import java.io.IOException;
* @author David Schweinsberg
*/
public abstract class CmapFormat {
-
+
public class Range {
-
+
private int _startCode;
private int _endCode;
-
+
protected Range(int startCode, int endCode) {
_startCode = startCode;
_endCode = endCode;
}
-
+
public int getStartCode() {
return _startCode;
}
-
+
public int getEndCode() {
return _endCode;
}
@@ -116,12 +116,12 @@ public abstract class CmapFormat {
}
public abstract int getRangeCount();
-
+
public abstract Range getRange(int index)
throws ArrayIndexOutOfBoundsException;
public abstract int mapCharCode(int charCode);
-
+
public String toString() {
return new StringBuilder()
.append("format: ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
index e374f82d2..2093158bd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
@@ -74,7 +74,7 @@ public class CmapFormat0 extends CmapFormat {
public int getRangeCount() {
return 1;
}
-
+
public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
if (index != 0) {
throw new ArrayIndexOutOfBoundsException();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
index 319d8c0d0..222c93852 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
@@ -67,7 +67,7 @@ public class CmapFormat2 extends CmapFormat {
int _idRangeOffset;
int _arrayIndex;
}
-
+
private int[] _subHeaderKeys = new int[256];
private SubHeader[] _subHeaders;
private int[] _glyphIndexArray;
@@ -75,9 +75,9 @@ public class CmapFormat2 extends CmapFormat {
protected CmapFormat2(DataInput di) throws IOException {
super(di);
_format = 2;
-
+
int pos = 6;
-
+
// Read the subheader keys, noting the highest value, as this will
// determine the number of subheaders to read.
int highest = 0;
@@ -88,7 +88,7 @@ public class CmapFormat2 extends CmapFormat {
}
int subHeaderCount = highest / 8 + 1;
_subHeaders = new SubHeader[subHeaderCount];
-
+
// Read the subheaders, once again noting the highest glyphIndexArray
// index range.
int indexArrayOffset = 8 * subHeaderCount + 518;
@@ -99,18 +99,18 @@ public class CmapFormat2 extends CmapFormat {
sh._entryCount = di.readUnsignedShort();
sh._idDelta = di.readShort();
sh._idRangeOffset = di.readUnsignedShort();
-
+
// Calculate the offset into the _glyphIndexArray
pos += 8;
sh._arrayIndex =
(pos - 2 + sh._idRangeOffset - indexArrayOffset) / 2;
-
+
// What is the highest range within the glyphIndexArray?
highest = Math.max(highest, sh._arrayIndex + sh._entryCount);
-
+
_subHeaders[i] = sh;
}
-
+
// Read the glyphIndexArray
_glyphIndexArray = new int[highest];
for (int i = 0; i < _glyphIndexArray.length; ++i) {
@@ -121,12 +121,12 @@ public class CmapFormat2 extends CmapFormat {
public int getRangeCount() {
return _subHeaders.length;
}
-
+
public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
if (index < 0 || index >= _subHeaders.length) {
throw new ArrayIndexOutOfBoundsException();
}
-
+
// Find the high-byte (if any)
int highByte = 0;
if (index != 0) {
@@ -137,7 +137,7 @@ public class CmapFormat2 extends CmapFormat {
}
}
}
-
+
return new Range(
highByte | _subHeaders[index]._firstCode,
highByte | (_subHeaders[index]._firstCode +
@@ -145,7 +145,7 @@ public class CmapFormat2 extends CmapFormat {
}
public int mapCharCode(int charCode) {
-
+
// Get the appropriate subheader
int index = 0;
int highByte = charCode >> 8;
@@ -153,14 +153,14 @@ public class CmapFormat2 extends CmapFormat {
index = _subHeaderKeys[highByte] / 8;
}
SubHeader sh = _subHeaders[index];
-
+
// Is the charCode out-of-range?
int lowByte = charCode & 0xff;
if (lowByte < sh._firstCode ||
lowByte >= (sh._firstCode + sh._entryCount)) {
return 0;
}
-
+
// Now calculate the glyph index
int glyphIndex =
_glyphIndexArray[sh._arrayIndex + (lowByte - sh._firstCode)];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
index c09bdc8c3..ef65867af 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
@@ -102,7 +102,7 @@ public class CmapFormat4 extends CmapFormat {
for (int i = 0; i < count; i++) {
_glyphIdArray[i] = di.readUnsignedShort();
} // + 2*count (8*segCount + 2*count + 18)
-
+
// Are there any padding bytes we need to consume?
// int leftover = length - (8*segCount + 2*count + 18);
// if (leftover > 0) {
@@ -113,7 +113,7 @@ public class CmapFormat4 extends CmapFormat {
public int getRangeCount() {
return _segCount;
}
-
+
public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
if (index < 0 || index >= _segCount) {
throw new ArrayIndexOutOfBoundsException();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
index a58531d11..a22e33244 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
@@ -67,7 +67,7 @@ public class CmapFormat6 extends CmapFormat {
protected CmapFormat6(DataInput di) throws IOException {
super(di);
_format = 6;
-
+
// HACK: As this is not yet implemented, we need to skip over the bytes
// we should be consuming
//di.skipBytes(_length - 4);
@@ -76,7 +76,7 @@ public class CmapFormat6 extends CmapFormat {
public int getRangeCount() {
return 0;
}
-
+
public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
throw new ArrayIndexOutOfBoundsException();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
index 83366b593..3544b6f62 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
@@ -30,12 +30,12 @@ import java.io.IOException;
* @version $Id: CmapFormatUnknown.java,v 1.1 2004-12-21 10:21:23 davidsch Exp $
*/
public class CmapFormatUnknown extends CmapFormat {
-
+
/** Creates a new instance of CmapFormatUnknown */
protected CmapFormatUnknown(int format, DataInput di) throws IOException {
super(di);
_format = format;
-
+
// We don't know how to handle this data, so we'll just skip over it
di.skipBytes(_length - 4);
}
@@ -43,7 +43,7 @@ public class CmapFormatUnknown extends CmapFormat {
public int getRangeCount() {
return 0;
}
-
+
public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
throw new ArrayIndexOutOfBoundsException();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
index 85fdf7225..47f6c470d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
@@ -85,7 +85,7 @@ public class CmapIndexEntry implements Comparable {
public CmapFormat getFormat() {
return _format;
}
-
+
public void setFormat(CmapFormat format) {
_format = format;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
index 0050fdd8e..016efa093 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
@@ -94,7 +94,7 @@ public class CmapTable implements Table {
} else if (_entries[i].getOffset() > bytesRead) {
di.skipBytes(_entries[i].getOffset() - (int) bytesRead);
} else if (_entries[i].getOffset() != bytesRead) {
-
+
// Something is amiss
throw new IOException();
}
@@ -109,15 +109,15 @@ public class CmapTable implements Table {
public int getVersion() {
return _version;
}
-
+
public int getNumTables() {
return _numTables;
}
-
+
public CmapIndexEntry getCmapIndexEntry(int i) {
return _entries[i];
}
-
+
public CmapFormat getCmapFormat(short platformId, short encodingId) {
// Find the requested format
@@ -148,7 +148,7 @@ public class CmapTable implements Table {
// }
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
index e85fadb5e..4f526f51d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
@@ -68,7 +68,7 @@ public abstract class Coverage {
* can't be found.
*/
public abstract int findGlyph(int glyphId);
-
+
protected static Coverage read(DataInput di) throws IOException {
Coverage c = null;
int format = di.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
index 963163584..867ef1823 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -47,7 +47,7 @@ public class CvtTable implements Table {
}
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -57,5 +57,5 @@ public class CvtTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
index 6b4af6908..5451f4502 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
index c98f03fe9..7abcec0ce 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
@@ -70,7 +70,7 @@ public class DirectoryEntry implements Cloneable {
_offset = di.readInt();
_length = di.readInt();
}
-
+
public Object clone() {
try {
return super.clone();
@@ -103,7 +103,7 @@ public class DirectoryEntry implements Cloneable {
.append((char)((_tag)&0xff))
.toString();
}
-
+
public String toString() {
return new StringBuilder()
.append("'").append(getTagAsString())
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
index 4b41f451d..4a09a4c34 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -21,7 +21,7 @@ public class DsigEntry {
private int format;
private int length;
private int offset;
-
+
/** Creates new DsigEntry */
protected DsigEntry(DataInput di) throws IOException {
format = di.readInt();
@@ -32,11 +32,11 @@ public class DsigEntry {
public int getFormat() {
return format;
}
-
+
public int getLength() {
return length;
}
-
+
public int getOffset() {
return offset;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
index e2784f9e6..f25c595d0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -48,7 +48,7 @@ public class DsigTable implements Table {
public int getType() {
return DSIG;
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -58,7 +58,7 @@ public class DsigTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder().append("DSIG\n");
for (int i = 0; i < numSigs; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
index 3cfb54a38..fdedca94a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
@@ -66,11 +66,11 @@ public class FeatureList {
/** Creates new FeatureList */
public FeatureList(DataInputStream dis, int offset) throws IOException {
-
+
// Ensure we're in the right place
dis.reset();
dis.skipBytes(offset);
-
+
// Start reading
_featureCount = dis.readUnsignedShort();
_featureRecords = new FeatureRecord[_featureCount];
@@ -88,11 +88,11 @@ public class FeatureList {
public int getFeatureCount() {
return _featureCount;
}
-
+
public FeatureRecord getFeatureRecord(int i) {
return _featureRecords[i];
}
-
+
public Feature getFeature(int i) {
return _features[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
index eb610814b..1da74f4d5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
@@ -72,7 +72,7 @@ public class FeatureRecord {
public int getTag() {
return _tag;
}
-
+
public int getOffset() {
return _offset;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
index 9a6000156..b662265d9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -33,7 +33,7 @@ public class FpgmTable extends Program implements Table {
public String toString() {
return Disassembler.disassemble(getInstructions(), 0);
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -43,5 +43,5 @@ public class FpgmTable extends Program implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
index 2748406df..cf4afa88e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -20,10 +20,10 @@ public class GaspRange {
public static final int GASP_GRIDFIT = 1;
public static final int GASP_DOGRAY = 2;
-
+
private int rangeMaxPPEM;
private int rangeGaspBehavior;
-
+
/** Creates new GaspRange */
protected GaspRange(DataInput di) throws IOException {
rangeMaxPPEM = di.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
index a83db5bff..45498eda1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -22,7 +22,7 @@ public class GaspTable implements Table {
private int version;
private int numRanges;
private GaspRange[] gaspRange;
-
+
/** Creates new GaspTable */
protected GaspTable(DirectoryEntry de, DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
@@ -49,7 +49,7 @@ public class GaspTable implements Table {
}
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -59,5 +59,5 @@ public class GaspTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
index 4cf254198..50f62ed62 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
@@ -73,7 +73,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
int glyphIndex,
DataInput di) throws IOException {
super(parentTable, glyphIndex, (short) -1, di);
-
+
// Get all of the composite components
GlyfCompositeComp comp;
int firstIndex = 0;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
index a9342a434..a7e2e7b69 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
@@ -111,7 +111,7 @@ public abstract class GlyfDescript extends Program implements GlyphDescription {
public short getYMinimum() {
return _yMin;
}
-
+
public String toString() {
return new StringBuilder()
.append(" numberOfContours: ").append(_numberOfContours)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
index c11d2d8ff..f67162cff 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
@@ -73,7 +73,7 @@ public class GlyfSimpleDescript extends GlyfDescript {
short numberOfContours,
DataInput di) throws IOException {
super(parentTable, glyphIndex, numberOfContours, di);
-
+
// Simple glyph description
_endPtsOfContours = new int[numberOfContours];
for (int i = 0; i < numberOfContours; i++) {
@@ -184,7 +184,7 @@ public class GlyfSimpleDescript extends GlyfDescript {
System.out.println("error: array index out of bounds");
}
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(super.toString());
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
index 22fdd8886..34a8218d9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
@@ -71,12 +71,12 @@ public class GlyfTable implements Table {
LocaTable loca) throws IOException {
_de = (DirectoryEntry) de.clone();
_descript = new GlyfDescript[maxp.getNumGlyphs()];
-
+
// Buffer the whole table so we can randomly access it
byte[] buf = new byte[de.getLength()];
di.readFully(buf);
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
-
+
// Process all the simple glyphs
for (int i = 0; i < maxp.getNumGlyphs(); i++) {
int len = loca.getOffset(i + 1) - loca.getOffset(i);
@@ -119,7 +119,7 @@ public class GlyfTable implements Table {
public int getType() {
return glyf;
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyphDescription.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyphDescription.java
index 106e17917..025778dfc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyphDescription.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyphDescription.java
@@ -56,29 +56,29 @@ package jogamp.graph.font.typecast.ot.table;
* @author David Schweinsberg
*/
public interface GlyphDescription {
-
+
public int getGlyphIndex();
-
+
public int getEndPtOfContours(int i);
-
+
public byte getFlags(int i);
-
+
public short getXCoordinate(int i);
-
+
public short getYCoordinate(int i);
-
+
public short getXMaximum();
-
+
public short getXMinimum();
-
+
public short getYMaximum();
-
+
public short getYMinimum();
-
+
public boolean isComposite();
-
+
public int getPointCount();
-
+
public int getContourCount();
// public int getComponentIndex(int c);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
index 91a62362a..9a367412d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
@@ -48,7 +48,7 @@ public class GposTable implements Table {
public int getType() {
return GPOS;
}
-
+
public String toString() {
return "GPOS";
}
@@ -62,5 +62,5 @@ public class GposTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return _de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
index c002de374..0351c903d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
@@ -66,10 +66,10 @@ public class GsubTable implements Table, LookupSubtableFactory {
private ScriptList _scriptList;
private FeatureList _featureList;
private LookupList _lookupList;
-
+
protected GsubTable(DirectoryEntry de, DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
-
+
// Load into a temporary buffer, and create another input stream
byte[] buf = new byte[de.getLength()];
di.readFully(buf);
@@ -86,17 +86,17 @@ public class GsubTable implements Table, LookupSubtableFactory {
// Feature List
_featureList = new FeatureList(dis, featureListOffset);
-
+
// Lookup List
_lookupList = new LookupList(dis, lookupListOffset, this);
}
/**
- * 1 - Single - Replace one glyph with one glyph
- * 2 - Multiple - Replace one glyph with more than one glyph
- * 3 - Alternate - Replace one glyph with one of many glyphs
- * 4 - Ligature - Replace multiple glyphs with one glyph
- * 5 - Context - Replace one or more glyphs in context
+ * 1 - Single - Replace one glyph with one glyph
+ * 2 - Multiple - Replace one glyph with more than one glyph
+ * 3 - Alternate - Replace one glyph with one of many glyphs
+ * 4 - Ligature - Replace multiple glyphs with one glyph
+ * 5 - Context - Replace one or more glyphs in context
* 6 - Chaining - Context Replace one or more glyphs in chained context
*/
public LookupSubtable read(
@@ -167,7 +167,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
}
return "Unknown";
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -177,5 +177,5 @@ public class GsubTable implements Table, LookupSubtableFactory {
public DirectoryEntry getDirectoryEntry() {
return _de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
index 5b1fa2020..42f9bf0d0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
@@ -30,9 +30,9 @@ import java.io.IOException;
* @version $Id: HdmxTable.java,v 1.2 2007-07-26 11:12:30 davidsch Exp $
*/
public class HdmxTable implements Table {
-
+
public class DeviceRecord {
-
+
private short _pixelSize;
private short _maxWidth;
private short[] _widths;
@@ -49,11 +49,11 @@ public class HdmxTable implements Table {
public short getPixelSize() {
return _pixelSize;
}
-
+
public short getMaxWidth() {
return _maxWidth;
}
-
+
public short[] getWidths() {
return _widths;
}
@@ -61,9 +61,9 @@ public class HdmxTable implements Table {
public short getWidth(int glyphidx) {
return _widths[glyphidx];
}
-
+
}
-
+
private DirectoryEntry _de;
private int _version;
private short _numRecords;
@@ -78,7 +78,7 @@ public class HdmxTable implements Table {
_numRecords = di.readShort();
_sizeDeviceRecords = di.readInt();
_records = new DeviceRecord[_numRecords];
-
+
// Read the device records
for (int i = 0; i < _numRecords; ++i) {
_records[i] = new DeviceRecord(maxp.getNumGlyphs(), di);
@@ -88,15 +88,15 @@ public class HdmxTable implements Table {
public int getNumberOfRecords() {
return _numRecords;
}
-
+
public DeviceRecord getRecord(int i) {
return _records[i];
}
-
+
public int getType() {
return hdmx;
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("'hdmx' Table - Horizontal Device Metrics\n----------------------------------------\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
index 9d7fe4251..cf7c58449 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
@@ -192,7 +192,7 @@ public class HeadTable implements Table {
.append("\n glyphDataFormat: ").append(_glyphDataFormat)
.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -202,5 +202,5 @@ public class HeadTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return _de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
index 20a21e4d9..0278929f1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -122,7 +122,7 @@ public class HheaTable implements Table {
.append("\n numOf_LongHorMetrics: ").append(numberOfHMetrics)
.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -132,5 +132,5 @@ public class HheaTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
index 9fd66e728..eed8c1841 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
@@ -38,7 +38,7 @@ public abstract class ID {
public static final short encodingUnicode11Semantics = 1;
public static final short encodingISO10646Semantics = 2;
public static final short encodingUnicode20Semantics = 3;
-
+
// Microsoft Encoding IDs
// public static final short encodingUndefined = 0;
// public static final short encodingUGL = 1;
@@ -203,7 +203,7 @@ public abstract class ID {
public static String getEncodingName(short platformId, short encodingId) {
if (platformId == platformUnicode) {
-
+
// Unicode specific encodings
switch (encodingId) {
case encodingUnicode10Semantics: return "Unicode 1.0 semantics";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
index 7a4cccba2..04fd646a7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -21,7 +21,7 @@ public abstract class KernSubtable {
/** Creates new KernSubtable */
protected KernSubtable() {
}
-
+
public abstract int getKerningPairCount();
public abstract KerningPair getKerningPair(int i);
@@ -32,7 +32,7 @@ public abstract class KernSubtable {
int length = di.readUnsignedShort();
int coverage = di.readUnsignedShort();
int format = coverage >> 8;
-
+
switch (format) {
case 0:
table = new KernSubtableFormat0(di);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
index b55bef6d5..89e6f9f11 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -17,7 +17,7 @@ import java.io.IOException;
* @version $Id: KernSubtableFormat0.java,v 1.1.1.1 2004-12-05 23:14:48 davidsch Exp $
*/
public class KernSubtableFormat0 extends KernSubtable {
-
+
private int nPairs;
private int searchRange;
private int entrySelector;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
index 60d584ca6..6f5e1f5e8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
index 70aee70d2..1d526865a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -17,7 +17,7 @@ import java.io.IOException;
* @version $Id: KernTable.java,v 1.1.1.1 2004-12-05 23:14:48 davidsch Exp $
*/
public class KernTable implements Table {
-
+
private DirectoryEntry de;
private int version;
private int nTables;
@@ -37,7 +37,7 @@ public class KernTable implements Table {
public int getSubtableCount() {
return nTables;
}
-
+
public KernSubtable getSubtable(int i) {
return tables[i];
}
@@ -58,5 +58,5 @@ public class KernTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
index ce7cebc97..52f82cc85 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
index 6759208f5..1ab112a78 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
@@ -64,7 +64,7 @@ public class LangSys {
private int _reqFeatureIndex;
private int _featureCount;
private int[] _featureIndex;
-
+
/** Creates new LangSys */
protected LangSys(DataInput di) throws IOException {
_lookupOrder = di.readUnsignedShort();
@@ -75,19 +75,19 @@ public class LangSys {
_featureIndex[i] = di.readUnsignedShort();
}
}
-
+
public int getLookupOrder() {
return _lookupOrder;
}
-
+
public int getReqFeatureIndex() {
return _reqFeatureIndex;
}
-
+
public int getFeatureCount() {
return _featureCount;
}
-
+
public int getFeatureIndex(int i) {
return _featureIndex[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
index 9511f66ba..f3befe3b6 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
@@ -62,7 +62,7 @@ public class LangSysRecord {
private int _tag;
private int _offset;
-
+
/** Creates new LangSysRecord */
public LangSysRecord(DataInput di) throws IOException {
_tag = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
index d3e2ad5cd..de862a983 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
@@ -73,11 +73,11 @@ public class Ligature {
_components[i] = di.readUnsignedShort();
}
}
-
+
public int getGlyphCount() {
return _compCount;
}
-
+
public int getGlyphId(int i) {
return (i == 0) ? _ligGlyph : _components[i-1];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
index a0f42662c..cad5e106a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
@@ -91,5 +91,5 @@ public class LigatureSubstFormat1 extends LigatureSubst {
public String getTypeAsString() {
return "LigatureSubstFormat1";
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
index 5eb7c5856..ce0862eea 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -64,7 +64,7 @@ public class LocaTable implements Table {
}
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
index 2899c24d9..6496c3791 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
@@ -79,7 +79,7 @@ public class Lookup {
// Ensure we're in the right place
dis.reset();
dis.skipBytes(offset);
-
+
// Start reading
_type = dis.readUnsignedShort();
_flag = dis.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
index a3b71b639..e70a932e4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
@@ -67,11 +67,11 @@ public class LookupList {
/** Creates new LookupList */
public LookupList(DataInputStream dis, int offset, LookupSubtableFactory factory)
throws IOException {
-
+
// Ensure we're in the right place
dis.reset();
dis.skipBytes(offset);
-
+
// Start reading
_lookupCount = dis.readUnsignedShort();
_lookupOffsets = new int[_lookupCount];
@@ -87,11 +87,11 @@ public class LookupList {
public int getLookupCount() {
return _lookupCount;
}
-
+
public int getLookupOffset(int i) {
return _lookupOffsets[i];
}
-
+
public Lookup getLookup(int i) {
return _lookups[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupSubtableFactory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupSubtableFactory.java
index cb4d28d2c..ca67df7fb 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupSubtableFactory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupSubtableFactory.java
@@ -47,13 +47,13 @@
Apache Software Foundation, please see .
*/
-
+
package jogamp.graph.font.typecast.ot.table;
import java.io.DataInputStream;
import java.io.IOException;
-/**
+/**
*
* @author David Schweinsberg
* @version $Id: LookupSubtableFactory.java,v 1.2 2007-01-24 09:47:46 davidsch Exp $
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
index ace3d38b5..9b0c8e6b4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -22,7 +22,7 @@ public class LtshTable implements Table {
private int version;
private int numGlyphs;
private int[] yPels;
-
+
/** Creates new LtshTable */
protected LtshTable(DirectoryEntry de, DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
@@ -41,7 +41,7 @@ public class LtshTable implements Table {
public int getType() {
return LTSH;
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("'LTSH' Table - Linear Threshold Table\n-------------------------------------")
@@ -54,7 +54,7 @@ public class LtshTable implements Table {
}
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -64,5 +64,5 @@ public class LtshTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
index 0e8ec44c7..5ab6b51ca 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -39,7 +39,7 @@ public class MaxpTable implements Table {
protected MaxpTable(DirectoryEntry de, DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
versionNumber = di.readInt();
-
+
// CFF fonts use version 0.5, TrueType fonts use version 1.0
if (versionNumber == 0x00005000) {
numGlyphs = di.readUnsignedShort();
@@ -149,7 +149,7 @@ public class MaxpTable implements Table {
}
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -159,5 +159,5 @@ public class MaxpTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
index 268d6cfca..9f9822986 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
@@ -75,19 +75,19 @@ public class NameRecord {
_stringLength = di.readShort();
_stringOffset = di.readShort();
}
-
+
public short getEncodingId() {
return _encodingId;
}
-
+
public short getLanguageId() {
return _languageId;
}
-
+
public short getNameId() {
return _nameId;
}
-
+
public short getPlatformId() {
return _platformId;
}
@@ -101,7 +101,7 @@ public class NameRecord {
StringBuilder sb = new StringBuilder();
di.skipBytes(_stringOffset);
if (_platformId == ID.platformUnicode) {
-
+
// Unicode (big-endian)
for (int i = 0; i < _stringLength/2; i++) {
sb.append(di.readChar());
@@ -113,13 +113,13 @@ public class NameRecord {
sb.append((char) di.readByte());
}
} else if (_platformId == ID.platformISO) {
-
+
// ISO encoding, ASCII
for (int i = 0; i < _stringLength; i++) {
sb.append((char) di.readByte());
}
} else if (_platformId == ID.platformMicrosoft) {
-
+
// Microsoft encoding, Unicode
char c;
for (int i = 0; i < _stringLength/2; i++) {
@@ -132,7 +132,7 @@ public class NameRecord {
public String toString() {
StringBuilder sb = new StringBuilder();
-
+
sb.append(" Platform ID: ").append(_platformId)
.append("\n Specific ID: ").append(_encodingId)
.append("\n Language ID: ").append(_languageId)
@@ -140,7 +140,7 @@ public class NameRecord {
.append("\n Length: ").append(_stringLength)
.append("\n Offset: ").append(_stringOffset)
.append("\n\n").append(_record);
-
+
return sb.toString();
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
index 6daf2ad60..5b7a17d3b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
@@ -68,25 +68,25 @@ public class NameTable implements Table {
private short _numberOfNameRecords;
private short _stringStorageOffset;
private NameRecord[] _records;
-
+
protected NameTable(DirectoryEntry de, DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_formatSelector = di.readShort();
_numberOfNameRecords = di.readShort();
_stringStorageOffset = di.readShort();
_records = new NameRecord[_numberOfNameRecords];
-
+
// Load the records, which contain the encoding information and string
// offsets
for (int i = 0; i < _numberOfNameRecords; i++) {
_records[i] = new NameRecord(di);
}
-
+
// Load the string data into a buffer so the records can copy out the
// bits they are interested in
byte[] buffer = new byte[_de.getLength() - _stringStorageOffset];
di.readFully(buffer);
-
+
// Now let the records get their hands on them
for (int i = 0; i < _numberOfNameRecords; i++) {
_records[i].loadString(
@@ -98,7 +98,7 @@ public class NameTable implements Table {
return _numberOfNameRecords;
}
-
+
public NameRecord getRecord(int i) {
if(_numberOfNameRecords > i) {
return _records[i];
@@ -133,7 +133,7 @@ public class NameTable implements Table {
public int getType() {
return name;
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -143,5 +143,5 @@ public class NameTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return _de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
index f4fa76e81..9dfbceb99 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
@@ -134,7 +134,7 @@ public class Os2Table implements Table {
_usWinDescent = di.readUnsignedShort();
_ulCodePageRange1 = di.readInt();
_ulCodePageRange2 = di.readInt();
-
+
// OpenType 1.3
if (_version == 2) {
_sxHeight = di.readShort();
@@ -276,19 +276,19 @@ public class Os2Table implements Table {
public short getXHeight() {
return _sxHeight;
}
-
+
public short getCapHeight() {
return _sCapHeight;
}
-
+
public int getDefaultChar() {
return _usDefaultChar;
}
-
+
public int getBreakChar() {
return _usBreakChar;
}
-
+
public int getMaxContext() {
return _usMaxContext;
}
@@ -335,7 +335,7 @@ public class Os2Table implements Table {
.append("\n CodePage Range 2( Bits 32- 63 ): ").append(Integer.toHexString(_ulCodePageRange2).toUpperCase())
.toString();
}
-
+
private String getVendorIDAsString() {
return new StringBuilder()
.append((char)((_achVendorID>>24)&0xff))
@@ -344,7 +344,7 @@ public class Os2Table implements Table {
.append((char)((_achVendorID)&0xff))
.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
index 6127140d1..1f6c5a1dd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -42,11 +42,11 @@ public class Panose {
public byte getFamilyType() {
return bFamilyType;
}
-
+
public byte getSerifStyle() {
return bSerifStyle;
}
-
+
public byte getWeight() {
return bWeight;
}
@@ -54,31 +54,31 @@ public class Panose {
public byte getProportion() {
return bProportion;
}
-
+
public byte getContrast() {
return bContrast;
}
-
+
public byte getStrokeVariation() {
return bStrokeVariation;
}
-
+
public byte getArmStyle() {
return bArmStyle;
}
-
+
public byte getLetterForm() {
return bLetterform;
}
-
+
public byte getMidline() {
return bMidline;
}
-
+
public byte getXHeight() {
return bXHeight;
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(String.valueOf(bFamilyType)).append(" ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
index f9dcf2ce7..6ed9b2b9c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -68,7 +68,7 @@ public class PcltTable implements Table {
public int getType() {
return PCLT;
}
-
+
public String toString() {
return new StringBuilder()
.append("'PCLT' Table - Printer Command Language Table\n---------------------------------------------")
@@ -91,7 +91,7 @@ public class PcltTable implements Table {
.append("\n reserved: ").append(reserved)
.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -101,5 +101,5 @@ public class PcltTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
index c913b4c71..46f1ac088 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -294,7 +294,7 @@ public class PostTable implements Table {
private int maxMemType42;
private int minMemType1;
private int maxMemType1;
-
+
// v2
private int numGlyphs;
private int[] glyphNameIndex;
@@ -312,7 +312,7 @@ public class PostTable implements Table {
maxMemType42 = di.readInt();
minMemType1 = di.readInt();
maxMemType1 = di.readInt();
-
+
if (version == 0x00020000) {
numGlyphs = di.readUnsignedShort();
glyphNameIndex = new int[numGlyphs];
@@ -366,7 +366,7 @@ public class PostTable implements Table {
return false;
}
}
-
+
/** Get the table type, as a table directory value.
* @return The table type
*/
@@ -409,7 +409,7 @@ public class PostTable implements Table {
}
return sb.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -419,5 +419,5 @@ public class PostTable implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
index aac10c539..2046d7fe4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -33,7 +33,7 @@ public class PrepTable extends Program implements Table {
public String toString() {
return Disassembler.disassemble(getInstructions(), 0);
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
@@ -43,5 +43,5 @@ public class PrepTable extends Program implements Table {
public DirectoryEntry getDirectoryEntry() {
return de;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
index 28c148c2b..e3beabef8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
index 72d703bb4..40ddf4215 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
@@ -75,7 +75,7 @@ public class RangeRecord {
public boolean isInRange(int glyphId) {
return (_start <= glyphId && glyphId <= _end);
}
-
+
public int getCoverageIndex(int glyphId) {
if (isInRange(glyphId)) {
return _startCoverageIndex + glyphId - _start;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
index eb534b5dd..04781a8f9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
@@ -65,14 +65,14 @@ public class Script {
private LangSysRecord[] _langSysRecords;
private LangSys _defaultLangSys;
private LangSys[] _langSys;
-
+
/** Creates new ScriptTable */
protected Script(DataInputStream dis, int offset) throws IOException {
// Ensure we're in the right place
dis.reset();
dis.skipBytes(offset);
-
+
// Start reading
_defaultLangSysOffset = dis.readUnsignedShort();
_langSysCount = dis.readUnsignedShort();
@@ -102,7 +102,7 @@ public class Script {
public int getLangSysCount() {
return _langSysCount;
}
-
+
public LangSysRecord getLangSysRecord(int i) {
return _langSysRecords[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
index 4af62b0ee..18589b712 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
@@ -63,14 +63,14 @@ public class ScriptList {
private int _scriptCount = 0;
private ScriptRecord[] _scriptRecords;
private Script[] _scripts;
-
+
/** Creates new ScriptList */
protected ScriptList(DataInputStream dis, int offset) throws IOException {
-
+
// Ensure we're in the right place
dis.reset();
dis.skipBytes(offset);
-
+
// Start reading
_scriptCount = dis.readUnsignedShort();
_scriptRecords = new ScriptRecord[_scriptCount];
@@ -86,15 +86,15 @@ public class ScriptList {
public int getScriptCount() {
return _scriptCount;
}
-
+
public ScriptRecord getScriptRecord(int i) {
return _scriptRecords[i];
}
-
+
public Script getScript(int i) {
return _scripts[i];
}
-
+
public Script findScript(String tag) {
if (tag.length() != 4) {
return null;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
index 5da0608dd..183ca2ffd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
@@ -62,7 +62,7 @@ public class ScriptRecord {
private int _tag;
private int _offset;
-
+
/** Creates new ScriptRecord */
protected ScriptRecord(DataInput di) throws IOException {
_tag = di.readInt();
@@ -72,7 +72,7 @@ public class ScriptRecord {
public int getTag() {
return _tag;
}
-
+
public int getOffset() {
return _offset;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
index 5a5de119f..15f0cd04f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -22,7 +22,7 @@ public class SignatureBlock {
private int reserved2;
private int signatureLen;
private byte[] signature;
-
+
/** Creates new SignatureBlock */
protected SignatureBlock(DataInput di) throws IOException {
reserved1 = di.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
index 8c56a740f..e31281f2e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
@@ -63,7 +63,7 @@ public abstract class SingleSubst extends LookupSubtable {
public abstract int getFormat();
public abstract int substitute(int glyphId);
-
+
public static SingleSubst read(DataInputStream dis, int offset) throws IOException {
SingleSubst s = null;
dis.reset();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
index 99b85f35c..a8df78504 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
@@ -84,7 +84,7 @@ public class SingleSubstFormat1 extends SingleSubst {
}
return glyphId;
}
-
+
public String getTypeAsString() {
return "SingleSubstFormat1";
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
index cd3b6d147..2e47b2924 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
@@ -92,6 +92,6 @@ public class SingleSubstFormat2 extends SingleSubst {
public String getTypeAsString() {
return "SingleSubstFormat2";
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
index b801517f8..f7c7d99b5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -17,7 +17,7 @@ import java.io.IOException;
* @author David Schweinsberg
*/
public class TTCHeader {
-
+
public static final int ttcf = 0x74746366;
private int ttcTag;
@@ -47,7 +47,7 @@ public class TTCHeader {
public int getDirectoryCount() {
return directoryCount;
}
-
+
public int getTableDirectory(int i) {
return tableDirectory[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Table.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Table.java
index 624f47bef..30fd2f457 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Table.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Table.java
@@ -1,9 +1,9 @@
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1, a copy of which has been included with this distribution in *
- * the LICENSE file. *
+ * ------------------------------------------------------------------------- *
+ * This software is published under the terms of the Apache Software License *
+ * version 1.1, a copy of which has been included with this distribution in *
+ * the LICENSE file. *
*****************************************************************************/
package jogamp.graph.font.typecast.ot.table;
@@ -51,7 +51,7 @@ public interface Table {
public static final int vmtx = 0x766d7478; // Vertical Metrics
public static final String notAvailable = "n/a";
-
+
/**
* Get the table type, as a table directory value.
* @return The table type
@@ -65,5 +65,5 @@ public interface Table {
* @return A directory entry
*/
public DirectoryEntry getDirectoryEntry();
-
+
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
index bacc26d30..8c5678088 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
@@ -112,7 +112,7 @@ public class TableDirectory {
public int getVersion() {
return _version;
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder()
.append("Offset Table\n------ -----")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
index 7749ea856..65aa84bff 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
@@ -26,7 +26,7 @@ package jogamp.graph.font.typecast.ot.table;
* @version $Id: TableException.java,v 1.1.1.1 2004-12-05 23:15:00 davidsch Exp $
*/
public class TableException extends java.lang.Exception {
-
+
private static final long serialVersionUID = 1L;
/**
@@ -34,8 +34,8 @@ public class TableException extends java.lang.Exception {
*/
public TableException() {
}
-
-
+
+
/**
* Constructs an instance of TableException with the specified detail message.
* @param msg the detail message.
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
index 998ce08e3..956d1aecd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
@@ -47,7 +47,7 @@
Apache Software Foundation, please see .
*/
-
+
package jogamp.graph.font.typecast.ot.table;
import java.io.DataInputStream;
@@ -56,7 +56,7 @@ import java.io.IOException;
import jogamp.graph.font.typecast.ot.OTFont;
import jogamp.graph.font.typecast.ot.OTFontCollection;
-/**
+/**
*
* @version $Id: TableFactory.java,v 1.7 2007-02-05 12:39:51 davidsch Exp $
* @author David Schweinsberg
@@ -69,7 +69,7 @@ public class TableFactory {
DirectoryEntry de,
DataInputStream dis) throws IOException {
Table t = null;
-
+
// First, if we have a font collection, look for the table there
if (fc != null) {
t = fc.getTable(de);
@@ -77,7 +77,7 @@ public class TableFactory {
return t;
}
}
-
+
// Create the table
switch (de.getTag()) {
case Table.BASE:
@@ -175,7 +175,7 @@ public class TableFactory {
t = new VmtxTable(de, dis, font.getVheaTable(), font.getMaxpTable());
break;
}
-
+
// If we have a font collection, add this table to it
if ((fc != null) && (t != null)) {
fc.addTable(t);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
index 80579f5cd..28f9aa6e3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
@@ -31,12 +31,12 @@ import java.io.IOException;
public class VdmxTable implements Table {
private class Ratio {
-
+
private byte _bCharSet;
private byte _xRatio;
private byte _yStartRatio;
private byte _yEndRatio;
-
+
protected Ratio(DataInput di) throws IOException {
_bCharSet = di.readByte();
_xRatio = di.readByte();
@@ -47,26 +47,26 @@ public class VdmxTable implements Table {
public byte getBCharSet() {
return _bCharSet;
}
-
+
public byte getXRatio() {
return _xRatio;
}
-
+
public byte getYStartRatio() {
return _yStartRatio;
}
-
+
public byte getYEndRatio() {
return _yEndRatio;
}
}
-
+
private class VTableRecord {
-
+
private int _yPelHeight;
private short _yMax;
private short _yMin;
-
+
protected VTableRecord(DataInput di) throws IOException {
_yPelHeight = di.readUnsignedShort();
_yMax = di.readShort();
@@ -76,23 +76,23 @@ public class VdmxTable implements Table {
public int getYPelHeight() {
return _yPelHeight;
}
-
+
public short getYMax() {
return _yMax;
}
-
+
public short getYMin() {
return _yMin;
}
}
-
+
private class Group {
-
+
private int _recs;
private int _startsz;
private int _endsz;
private VTableRecord[] _entry;
-
+
protected Group(DataInput di) throws IOException {
_recs = di.readUnsignedShort();
_startsz = di.readUnsignedByte();
@@ -106,20 +106,20 @@ public class VdmxTable implements Table {
public int getRecs() {
return _recs;
}
-
+
public int getStartSZ() {
return _startsz;
}
-
+
public int getEndSZ() {
return _endsz;
}
-
+
public VTableRecord[] getEntry() {
return _entry;
}
}
-
+
private DirectoryEntry _de;
private int _version;
private int _numRecs;
@@ -127,7 +127,7 @@ public class VdmxTable implements Table {
private Ratio[] _ratRange;
private int _offset[];
private Group[] _groups;
-
+
/** Creates a new instance of VdmxTable */
protected VdmxTable(DirectoryEntry de, DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
@@ -147,11 +147,11 @@ public class VdmxTable implements Table {
_groups[i] = new Group(di);
}
}
-
+
public int getType() {
return VDMX;
}
-
+
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("'VDMX' Table - Precomputed Vertical Device Metrics\n")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
index 19c91765b..f42da119b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
@@ -135,7 +135,7 @@ public class VheaTable implements Table {
.append("\n numOf_LongVerMetrics: ").append(_numberOfLongVerMetrics)
.toString();
}
-
+
/**
* Get a directory entry for this table. This uniquely identifies the
* table in collections where there may be more than one instance of a
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
index 887f8c34f..181ec7e10 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
@@ -34,23 +34,23 @@ import jogamp.graph.font.typecast.ot.table.CharstringType2;
* @version $Id: T2Interpreter.java,v 1.2 2007-07-26 11:10:18 davidsch Exp $
*/
public class T2Interpreter {
-
+
private static final int ARGUMENT_STACK_LIMIT = 48;
private static final int SUBR_STACK_LIMIT = 10;
private static final int TRANSIENT_ARRAY_ELEMENT_COUNT = 32;
-
+
private Number[] _argStack = new Number[ARGUMENT_STACK_LIMIT];
private int _argStackIndex = 0;
private int[] _subrStack = new int[SUBR_STACK_LIMIT];
private int _subrStackIndex = 0;
private Number[] _transientArray = new Number[TRANSIENT_ARRAY_ELEMENT_COUNT];
-
+
private ArrayList _points;
/** Creates a new instance of T2Interpreter */
public T2Interpreter() {
}
-
+
/**
* Moves the current point to a position at the relative coordinates
* (dx1, dy1).
@@ -72,7 +72,7 @@ public class T2Interpreter {
Point lastPoint = getLastPoint();
moveTo(lastPoint.x + dx1, lastPoint.y);
}
-
+
/**
* Moves the current point dy1 units in the vertical direction.
*/
@@ -82,7 +82,7 @@ public class T2Interpreter {
Point lastPoint = getLastPoint();
moveTo(lastPoint.x, lastPoint.y + dy1);
}
-
+
/**
* Appends a line from the current point to a position at the
* relative coordinates dxa, dya. Additional rlineto operations are
@@ -103,7 +103,7 @@ public class T2Interpreter {
}
clearArg();
}
-
+
/**
* Appends a horizontal line of length dx1 to the current point.
* With an odd number of arguments, subsequent argument pairs
@@ -130,7 +130,7 @@ public class T2Interpreter {
}
clearArg();
}
-
+
/**
* Appends a vertical line of length dy1 to the current point. With
* an odd number of arguments, subsequent argument pairs are
@@ -157,7 +157,7 @@ public class T2Interpreter {
}
clearArg();
}
-
+
/**
* Appends a Bezier curve, defined by dxa...dyc, to the current
* point. For each subsequent set of six arguments, an additional
@@ -194,7 +194,7 @@ public class T2Interpreter {
}
clearArg();
}
-
+
/**
* Appends one or more Bezier curves, as described by the
* dxa...dxc set of arguments, to the current point. For each curve,
@@ -230,7 +230,7 @@ public class T2Interpreter {
}
clearArg();
}
-
+
/**
* Appends one or more Bezier curves to the current point. The
* tangent for the first Bezier must be horizontal, and the second
@@ -327,13 +327,13 @@ public class T2Interpreter {
int yf = ye + dyf[i];
curveTo(xa, ya, xb, yb, xc, yc);
curveTo(xd, yd, xe, ye, xf, yf);
-
+
// What on earth do we do with dx1, dx2, dy2 and dy3?
}
}
clearArg();
}
-
+
/**
* Is equivalent to one rrcurveto for each set of six arguments
* dxa...dyc, followed by exactly one rlineto using the dxd, dyd
@@ -373,7 +373,7 @@ public class T2Interpreter {
lineTo(xc + dxd, yc + dyd);
clearArg();
}
-
+
/**
* Is equivalent to one rlineto for each pair of arguments beyond
* the six arguments dxb...dyd needed for the one rrcurveto
@@ -411,7 +411,7 @@ public class T2Interpreter {
curveTo(xb, yb, xc, yc, xd, yd);
clearArg();
}
-
+
/**
* Appends one or more Bezier curves to the current point, where
* the first tangent is vertical and the second tangent is horizontal.
@@ -465,7 +465,7 @@ public class T2Interpreter {
}
clearArg();
}
-
+
/**
* Appends one or more curves to the current point. If the argument
* count is a multiple of four, the curve starts and ends vertical. If
@@ -473,10 +473,10 @@ public class T2Interpreter {
* vertical tangent.
*/
private void _vvcurveto() {
-
+
clearArg();
}
-
+
/**
* Causes two Bezier curves, as described by the arguments (as
* shown in Figure 2 below), to be rendered as a straight line when
@@ -485,10 +485,10 @@ public class T2Interpreter {
* pixels.
*/
private void _flex() {
-
+
clearArg();
}
-
+
/**
* Causes the two curves described by the arguments dx1...dx6 to
* be rendered as a straight line when the flex depth is less than
@@ -496,10 +496,10 @@ public class T2Interpreter {
* flex depth is greater than or equal to 0.5 device pixels.
*/
private void _hflex() {
-
+
clearArg();
}
-
+
/**
* Causes the two curves described by the arguments to be
* rendered as a straight line when the flex depth is less than 0.5
@@ -507,10 +507,10 @@ public class T2Interpreter {
* than or equal to 0.5 device pixels.
*/
private void _hflex1() {
-
+
clearArg();
}
-
+
/**
* Causes the two curves described by the arguments to be
* rendered as a straight line when the flex depth is less than 0.5
@@ -518,10 +518,10 @@ public class T2Interpreter {
* than or equal to 0.5 device pixels.
*/
private void _flex1() {
-
+
clearArg();
}
-
+
/**
* Finishes a charstring outline definition, and must be the
* last operator in a character's outline.
@@ -530,37 +530,37 @@ public class T2Interpreter {
endContour();
clearArg();
}
-
+
private void _hstem() {
-
+
clearArg();
}
-
+
private void _vstem() {
-
+
clearArg();
}
-
+
private void _hstemhm() {
-
+
clearArg();
}
-
+
private void _vstemhm() {
-
+
clearArg();
}
-
+
private void _hintmask() {
-
+
clearArg();
}
-
+
private void _cntrmask() {
-
+
clearArg();
}
-
+
/**
* Returns the absolute value of num.
*/
@@ -568,7 +568,7 @@ public class T2Interpreter {
double num = popArg().doubleValue();
pushArg(Math.abs(num));
}
-
+
/**
* Returns the sum of the two numbers num1 and num2.
*/
@@ -577,7 +577,7 @@ public class T2Interpreter {
double num1 = popArg().doubleValue();
pushArg(num1 + num2);
}
-
+
/**
* Returns the result of subtracting num2 from num1.
*/
@@ -586,7 +586,7 @@ public class T2Interpreter {
double num1 = popArg().doubleValue();
pushArg(num1 - num2);
}
-
+
/**
* Returns the quotient of num1 divided by num2. The result is
* undefined if overflow occurs and is zero for underflow.
@@ -596,7 +596,7 @@ public class T2Interpreter {
double num1 = popArg().doubleValue();
pushArg(num1 / num2);
}
-
+
/**
* Returns the negative of num.
*/
@@ -604,7 +604,7 @@ public class T2Interpreter {
double num = popArg().doubleValue();
pushArg(-num);
}
-
+
/**
* Returns a pseudo random number num2 in the range (0,1], that
* is, greater than zero and less than or equal to one.
@@ -612,7 +612,7 @@ public class T2Interpreter {
private void _random() {
pushArg(1.0 - Math.random());
}
-
+
/**
* Returns the product of num1 and num2. If overflow occurs, the
* result is undefined, and zero is returned for underflow.
@@ -622,7 +622,7 @@ public class T2Interpreter {
double num1 = popArg().doubleValue();
pushArg(num1 * num2);
}
-
+
/**
* Returns the square root of num. If num is negative, the result is
* undefined.
@@ -631,14 +631,14 @@ public class T2Interpreter {
double num = popArg().doubleValue();
pushArg(Math.sqrt(num));
}
-
+
/**
* Removes the top element num from the Type 2 argument stack.
*/
private void _drop() {
popArg();
}
-
+
/**
* Exchanges the top two elements on the argument stack.
*/
@@ -648,7 +648,7 @@ public class T2Interpreter {
pushArg(num2);
pushArg(num1);
}
-
+
/**
* Retrieves the element i from the top of the argument stack and
* pushes a copy of that element onto that stack. If i is negative,
@@ -666,7 +666,7 @@ public class T2Interpreter {
}
pushArg(nums[i]);
}
-
+
/**
* Performs a circular shift of the elements num(Nx1) ... num0 on
* the argument stack by the amount J. Positive J indicates upward
@@ -685,7 +685,7 @@ public class T2Interpreter {
pushArg(nums[(n + i + j) % n]);
}
}
-
+
/**
* Duplicates the top element on the argument stack.
*/
@@ -694,7 +694,7 @@ public class T2Interpreter {
pushArg(any);
pushArg(any);
}
-
+
/**
* Stores val into the transient array at the location given by i.
*/
@@ -703,7 +703,7 @@ public class T2Interpreter {
Number val = popArg();
_transientArray[i] = val;
}
-
+
/**
* Retrieves the value stored in the transient array at the location
* given by i and pushes the value onto the argument stack. If get
@@ -714,7 +714,7 @@ public class T2Interpreter {
int i = popArg().intValue();
pushArg(_transientArray[i]);
}
-
+
/**
* Puts a 1 on the stack if num1 and num2 are both non-zero, and
* puts a 0 on the stack if either argument is zero.
@@ -724,7 +724,7 @@ public class T2Interpreter {
double num1 = popArg().doubleValue();
pushArg((num1!=0.0) && (num2!=0.0) ? 1 : 0);
}
-
+
/**
* Puts a 1 on the stack if either num1 or num2 are non-zero, and
* puts a 0 on the stack if both arguments are zero.
@@ -734,7 +734,7 @@ public class T2Interpreter {
double num1 = popArg().doubleValue();
pushArg((num1!=0.0) || (num2!=0.0) ? 1 : 0);
}
-
+
/**
* Returns a 0 if num1 is non-zero; returns a 1 if num1 is zero.
*/
@@ -742,7 +742,7 @@ public class T2Interpreter {
double num1 = popArg().doubleValue();
pushArg((num1!=0.0) ? 0 : 1);
}
-
+
/**
* Puts a 1 on the stack if num1 equals num2, otherwise a 0 (zero)
* is put on the stack.
@@ -752,7 +752,7 @@ public class T2Interpreter {
double num1 = popArg().doubleValue();
pushArg(num1 == num2 ? 1 : 0);
}
-
+
/**
* Leaves the value s1 on the stack if v1 ? v2, or leaves s2 on the
* stack if v1 > v2. The value of s1 and s2 is usually the biased
@@ -765,7 +765,7 @@ public class T2Interpreter {
Number s1 = popArg();
pushArg(v1 <= v2 ? s1 : s2);
}
-
+
/**
* Calls a charstring subroutine with index subr# (actually the subr
* number plus the subroutine bias number, as described in section
@@ -777,25 +777,25 @@ public class T2Interpreter {
* Calling an undefined subr (gsubr) has undefined results.
*/
private void _callsubr() {
-
+
}
-
+
/**
* Operates in the same manner as callsubr except that it calls a
* global subroutine.
*/
private void _callgsubr() {
-
+
}
-
+
/**
* Returns from either a local or global charstring subroutine, and
* continues execution after the corresponding call(g)subr.
*/
private void _return() {
-
+
}
-
+
public Point[] execute(CharstringType2 cs) {
_points = new ArrayList();
cs.resetIP();
@@ -975,7 +975,7 @@ public class T2Interpreter {
private int getArgCount() {
return _argStackIndex;
}
-
+
/**
* Pop a value off the argument stack
*/
@@ -989,7 +989,7 @@ public class T2Interpreter {
private void pushArg(Number n) {
_argStack[_argStackIndex++] = n;
}
-
+
/**
* Pop a value off the subroutine stack
*/
@@ -1003,14 +1003,14 @@ public class T2Interpreter {
private void pushSubr(int n) {
_subrStack[_subrStackIndex++] = n;
}
-
+
/**
* Clear the argument stack
*/
private void clearArg() {
_argStackIndex = 0;
}
-
+
private Point getLastPoint() {
int size = _points.size();
if (size > 0) {
@@ -1019,22 +1019,22 @@ public class T2Interpreter {
return new Point(0, 0, true, false);
}
}
-
+
private void moveTo(int x, int y) {
endContour();
_points.add(new Point(x, y, true, false));
}
-
+
private void lineTo(int x, int y) {
_points.add(new Point(x, y, true, false));
}
-
+
private void curveTo(int cx1, int cy1, int cx2, int cy2, int x, int y) {
_points.add(new Point(cx1, cy1, false, false));
_points.add(new Point(cx2, cy2, false, false));
_points.add(new Point(x, y, true, false));
}
-
+
private void endContour() {
Point lastPoint = getLastPoint();
if (lastPoint != null) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
index a659a7003..2bb5cec0c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
@@ -570,7 +570,7 @@ public class Interpreter {
private void _mps() {
push(0);
}
-
+
private void _msirp(short param) {
pop();
pop();
@@ -1190,7 +1190,7 @@ public class Interpreter {
while (ip < ((ip & 0xffff0000) | parser.getISLength(ip >> 16))) {
short opcode = parser.getOpcode(ip);
if (inFuncDef) {
-
+
// We're within a function definition, so don't execute the code
if (opcode == Mnemonic.ENDF) {
inFuncDef = false;
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
index 0fd174cda..32e2b6a39 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
@@ -33,7 +33,7 @@ public class AffineTransform implements Cloneable, Serializable {
private static final long serialVersionUID = 1330973210523860834L;
static final String determinantIsZero = "Determinant is zero";
-
+
public static final int TYPE_IDENTITY = 0;
public static final int TYPE_TRANSLATION = 1;
public static final int TYPE_UNIFORM_SCALE = 2;
@@ -49,14 +49,14 @@ public class AffineTransform implements Cloneable, Serializable {
* The TYPE_UNKNOWN is an initial type value
*/
static final int TYPE_UNKNOWN = -1;
-
+
/**
- * The min value equivalent to zero. If absolute value less then ZERO it considered as zero.
+ * The min value equivalent to zero. If absolute value less then ZERO it considered as zero.
*/
static final float ZERO = (float) 1E-10;
-
+
private final Vertex.Factory extends Vertex> pointFactory;
-
+
/**
* The values of transformation matrix
*/
@@ -68,7 +68,7 @@ public class AffineTransform implements Cloneable, Serializable {
float m12;
/**
- * The transformation type
+ * The transformation type
*/
transient int type;
@@ -123,20 +123,20 @@ public class AffineTransform implements Cloneable, Serializable {
/*
* Method returns type of affine transformation.
- *
+ *
* Transform matrix is
* m00 m01 m02
* m10 m11 m12
- *
- * According analytic geometry new basis vectors are (m00, m01) and (m10, m11),
- * translation vector is (m02, m12). Original basis vectors are (1, 0) and (0, 1).
- * Type transformations classification:
+ *
+ * According analytic geometry new basis vectors are (m00, m01) and (m10, m11),
+ * translation vector is (m02, m12). Original basis vectors are (1, 0) and (0, 1).
+ * Type transformations classification:
* TYPE_IDENTITY - new basis equals original one and zero translation
- * TYPE_TRANSLATION - translation vector isn't zero
+ * TYPE_TRANSLATION - translation vector isn't zero
* TYPE_UNIFORM_SCALE - vectors length of new basis equals
- * TYPE_GENERAL_SCALE - vectors length of new basis doesn't equal
+ * TYPE_GENERAL_SCALE - vectors length of new basis doesn't equal
* TYPE_FLIP - new basis vector orientation differ from original one
- * TYPE_QUADRANT_ROTATION - new basis is rotated by 90, 180, 270, or 360 degrees
+ * TYPE_QUADRANT_ROTATION - new basis is rotated by 90, 180, 270, or 360 degrees
* TYPE_GENERAL_ROTATION - new basis is rotated by arbitrary angle
* TYPE_GENERAL_TRANSFORM - transformation can't be inversed
*/
@@ -322,7 +322,7 @@ public class AffineTransform implements Cloneable, Serializable {
}
public static AffineTransform getShearInstance(Vertex.Factory extends Vertex> factory, float shx, float shy) {
- AffineTransform t = new AffineTransform(factory);
+ AffineTransform t = new AffineTransform(factory);
t.setToShear(shx, shy);
return t;
}
@@ -359,13 +359,13 @@ public class AffineTransform implements Cloneable, Serializable {
concatenate(AffineTransform.getRotateInstance(pointFactory, angle, px, py));
}
- /**
+ /**
* Multiply matrix of two AffineTransform objects.
* The first argument's {@link Vertex.Factory} is being used.
- *
+ *
* @param t1 - the AffineTransform object is a multiplicand
* @param t2 - the AffineTransform object is a multiplier
- * @return an AffineTransform object that is a result of t1 multiplied by matrix t2.
+ * @return an AffineTransform object that is a result of t1 multiplied by matrix t2.
*/
AffineTransform multiply(AffineTransform t1, AffineTransform t2) {
return new AffineTransform(t1.pointFactory,
@@ -415,7 +415,7 @@ public class AffineTransform implements Cloneable, Serializable {
public void transform(Vertex[] src, int srcOff, Vertex[] dst, int dstOff, int length) {
while (--length >= 0) {
- Vertex srcPoint = src[srcOff++];
+ Vertex srcPoint = src[srcOff++];
float x = srcPoint.getX();
float y = srcPoint.getY();
Vertex dstPoint = dst[dstOff];
@@ -426,7 +426,7 @@ public class AffineTransform implements Cloneable, Serializable {
dst[dstOff++] = dstPoint;
}
}
-
+
public void transform(float[] src, int srcOff, float[] dst, int dstOff, int length) {
int step = 2;
if (src == dst && srcOff < dstOff && dstOff < srcOff + length * 2) {
@@ -443,7 +443,7 @@ public class AffineTransform implements Cloneable, Serializable {
dstOff += step;
}
}
-
+
public Vertex deltaTransform(Vertex src, Vertex dst) {
if (dst == null) {
dst = pointFactory.create();
@@ -486,7 +486,7 @@ public class AffineTransform implements Cloneable, Serializable {
{
float det = getDeterminant();
if (FloatUtil.abs(det) < ZERO) {
- throw new NoninvertibleTransformException(determinantIsZero);
+ throw new NoninvertibleTransformException(determinantIsZero);
}
while (--length >= 0) {
@@ -554,7 +554,7 @@ public class AffineTransform implements Cloneable, Serializable {
return false;
}
-
+
/**
* Write AffineTrasform object to the output steam.
* @param stream - the output stream
@@ -564,12 +564,12 @@ public class AffineTransform implements Cloneable, Serializable {
stream.defaultWriteObject();
}
-
+
/**
* Read AffineTransform object from the input stream
* @param stream - the input steam
* @throws IOException - if there are I/O errors while reading from the input strem
- * @throws ClassNotFoundException - if class could not be found
+ * @throws ClassNotFoundException - if class could not be found
*/
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
index cd4ee2a91..4ee0c250d 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
@@ -29,17 +29,17 @@ public class Crossing {
* Allowable tolerance for bounds comparison
*/
static final float DELTA = (float) 1E-5;
-
+
/**
* If roots have distance less then ROOT_DELTA they are double
*/
static final float ROOT_DELTA = (float) 1E-10;
-
+
/**
* Rectangle cross segment
*/
public static final int CROSSING = 255;
-
+
/**
* Unknown crossing result
*/
@@ -130,8 +130,8 @@ public class Crossing {
}
/**
- * Excludes float roots. Roots are float if they lies enough close with each other.
- * @param res - the roots
+ * Excludes float roots. Roots are float if they lies enough close with each other.
+ * @param res - the roots
* @param rc - the roots count
* @return new roots count
*/
@@ -384,12 +384,12 @@ public class Crossing {
// START
if (x == x1) {
- return x1 < x2 ? 0 : -1;
+ return x1 < x2 ? 0 : -1;
}
-
+
// END
if (x == x2) {
- return x1 < x2 ? 1 : 0;
+ return x1 < x2 ? 1 : 0;
}
// INSIDE-DOWN
@@ -493,10 +493,10 @@ public class Crossing {
}
break;
default:
- throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
+ throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
}
-
- // checks if the point (x,y) is the vertex of shape with PathIterator p
+
+ // checks if the point (x,y) is the vertex of shape with PathIterator p
if (x == cx && y == cy) {
cross = 0;
cy = my;
@@ -554,9 +554,9 @@ public class Crossing {
}
}
}
-
+
/**
- * Returns are bounds intersect or not intersect rectangle
+ * Returns are bounds intersect or not intersect rectangle
*/
static int crossBound(float bound[], int bc, float py1, float py2) {
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
index 945eeceeb..c1ee17a4b 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
@@ -33,12 +33,12 @@ public final class Path2D implements Cloneable {
static final String invalidWindingRuleValue = "Invalid winding rule value";
static final String iteratorOutOfBounds = "Iterator out of bounds";
-
+
/**
* The buffers size
*/
private static final int BUFFER_SIZE = 10;
-
+
/**
* The buffers capacity
*/
@@ -48,24 +48,24 @@ public final class Path2D implements Cloneable {
* The point's types buffer
*/
byte[] types;
-
+
/**
* The points buffer
*/
float[] points;
-
+
/**
* The point's type buffer size
*/
int typeSize;
-
+
/**
* The points buffer size
*/
int pointSize;
-
+
/**
- * The path rule
+ * The path rule
*/
int rule;
@@ -80,7 +80,7 @@ public final class Path2D implements Cloneable {
0}; // CLOSE
/*
- * GeneralPath path iterator
+ * GeneralPath path iterator
*/
class Iterator implements PathIterator {
@@ -88,17 +88,17 @@ public final class Path2D implements Cloneable {
* The current cursor position in types buffer
*/
int typeIndex;
-
+
/**
* The current cursor position in points buffer
*/
int pointIndex;
-
+
/**
* The source GeneralPath object
*/
Path2D p;
-
+
/**
* The path iterator transformation
*/
@@ -183,7 +183,7 @@ public final class Path2D implements Cloneable {
}
/**
- * Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.
+ * Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.
* @param pointCount - the point count to be added in buffer
*/
void checkBuf(int pointCount, boolean checkMove) {
@@ -244,18 +244,18 @@ public final class Path2D implements Cloneable {
final public int size() {
return typeSize;
}
-
+
final public boolean isClosed() {
return typeSize > 0 && types[typeSize - 1] == PathIterator.SEG_CLOSE ;
}
-
+
public void closePath() {
if (!isClosed()) {
checkBuf(0, true);
types[typeSize++] = PathIterator.SEG_CLOSE;
}
}
-
+
public String toString() {
return "[size "+size()+", closed "+isClosed()+"]";
}
@@ -295,7 +295,7 @@ public final class Path2D implements Cloneable {
closePath();
break;
default:
- throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
+ throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
}
path.next();
connect = false;
@@ -366,9 +366,9 @@ public final class Path2D implements Cloneable {
}
/**
- * Checks cross count according to path rule to define is it point inside shape or not.
+ * Checks cross count according to path rule to define is it point inside shape or not.
* @param cross - the point cross count
- * @return true if point is inside path, or false otherwise
+ * @return true if point is inside path, or false otherwise
*/
boolean isInside(int cross) {
if (rule == WIND_NON_ZERO) {
@@ -396,7 +396,7 @@ public final class Path2D implements Cloneable {
}
public boolean contains(AABBox r) {
- return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
+ return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
}
public boolean intersects(AABBox r) {
@@ -404,9 +404,9 @@ public final class Path2D implements Cloneable {
}
public PathIterator iterator() {
- return new Iterator(this);
+ return new Iterator(this);
}
-
+
public PathIterator iterator(AffineTransform t) {
return new Iterator(this, t);
}
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() {
public Object run() {
PropertyAccess.addTrustedPrefix("jogl.");
return null;
} } );
-
+
verbose = isPropertyDefined("jogl.verbose", true);
debugAll = isPropertyDefined("jogl.debug", true);
if (verbose) {
@@ -68,7 +68,7 @@ public class Debug extends PropertyAccess {
System.err.println("JOGL implementation vendor " + p.getImplementationVendor());
}
}
-
+
/** Ensures static init block has been issues, i.e. if calling through to {@link PropertyAccess#isPropertyDefined(String, boolean)}. */
public static final void initSingleton() {}
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
index ef9477a31..578f416b7 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.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 java.util.List;
@@ -47,11 +47,11 @@ public abstract class DesktopGLDynamicLibraryBundleInfo extends GLDynamicLibrary
public final List getGlueLibNames() {
return glueLibNames;
}
-
+
@Override
public final boolean useToolGetProcAdressFirst(String funcName) {
return true;
}
-
+
}
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
index 8eb3468ed..a1023acd2 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.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.NativeLibrary;
diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
index 94acf93b0..b8bcd2e78 100644
--- a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
+++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.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.
*/
@@ -59,7 +59,7 @@ final class ExtensionAvailabilityCache {
}
/**
- * Flush the cache.
+ * Flush the cache.
*/
final void flush()
{
@@ -87,7 +87,7 @@ final class ExtensionAvailabilityCache {
validateInitialization();
return availableExtensionCache.size();
}
-
+
final boolean isExtensionAvailable(String glExtensionName) {
validateInitialization();
return availableExtensionCache.contains(glExtensionName);
@@ -97,7 +97,7 @@ final class ExtensionAvailabilityCache {
validateInitialization();
return glXExtensionCount;
}
-
+
final String getPlatformExtensionsString() {
validateInitialization();
return glXExtensions;
@@ -107,7 +107,7 @@ final class ExtensionAvailabilityCache {
validateInitialization();
return glExtensionCount;
}
-
+
final String getGLExtensionsString() {
validateInitialization();
if(DEBUG) {
@@ -151,7 +151,7 @@ final class ExtensionAvailabilityCache {
", use "+ ( useGetStringi ? "glGetStringi" : "glGetString" ) );
}
- HashSet glExtensionSet = new HashSet(gl.isGLES() ? 50 : 320); // far less gl extension expected on mobile
+ HashSet glExtensionSet = new HashSet(gl.isGLES() ? 50 : 320); // far less gl extension expected on mobile
if(useGetStringi) {
GL2GL3 gl2gl3 = gl.getGL2GL3();
final int count;
@@ -163,7 +163,7 @@ final class ExtensionAvailabilityCache {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < count; i++) {
if(i > 0) {
- sb.append(" ");
+ sb.append(" ");
}
final String ext = gl2gl3.glGetStringi(GL.GL_EXTENSIONS, i);
glExtensionSet.add(ext);
@@ -185,7 +185,7 @@ final class ExtensionAvailabilityCache {
}
}
}
- glExtensionCount = glExtensionSet.size();
+ glExtensionCount = glExtensionSet.size();
if (DEBUG) {
System.err.println(getThreadName() + ":ExtensionAvailabilityCache: GL_EXTENSIONS: "+glExtensionCount+
", used "+ ( useGetStringi ? "glGetStringi" : "glGetString" ) );
@@ -193,17 +193,17 @@ final class ExtensionAvailabilityCache {
// Platform Extensions
HashSet glXExtensionSet = new HashSet(50);
- {
- // unify platform extension .. might have duplicates
+ {
+ // unify platform extension .. might have duplicates
StringTokenizer tok = new StringTokenizer(context.getPlatformExtensionsStringImpl().toString());
while (tok.hasMoreTokens()) {
- glXExtensionSet.add(tok.nextToken().trim());
+ glXExtensionSet.add(tok.nextToken().trim());
}
final StringBuilder sb = new StringBuilder();
for(Iterator iter = glXExtensionSet.iterator(); iter.hasNext(); ) {
sb.append(iter.next());
if(iter.hasNext()) {
- sb.append(" ");
+ sb.append(" ");
}
}
glXExtensions = sb.toString();
@@ -222,7 +222,7 @@ final class ExtensionAvailabilityCache {
final int ctxOptions = context.getCtxOptions();
final VersionNumber version = context.getGLVersionNumber();
int major[] = new int[] { version.getMajor() };
- int minor[] = new int[] { version.getMinor() };
+ int minor[] = new int[] { version.getMinor() };
while (GLContext.isValidGLVersion(ctxOptions, major[0], minor[0])) {
final String GL_XX_VERSION = ( context.isGLES() ? "GL_ES_VERSION_" : "GL_VERSION_" ) + major[0] + "_" + minor[0];
availableExtensionCache.add(GL_XX_VERSION);
diff --git a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
index b74ac9f41..c96f7db32 100644
--- a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
+++ b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
@@ -41,39 +41,39 @@ public class FPSCounterImpl implements FPSCounter {
private long fpsStartTime, fpsLastUpdateTime, fpsLastPeriod, fpsTotalDuration;
private int fpsTotalFrames;
private float fpsLast, fpsTotal;
-
+
/** Creates a disabled instance */
public FPSCounterImpl() {
setUpdateFPSFrames(0, null);
}
-
+
/**
* Increases total frame count and updates values if feature is enabled and
* update interval is reached.
- *
+ *
* Shall be called by actual FPSCounter implementing renderer, after display a new frame.
- *
+ *
*/
public final synchronized void tickFPS() {
fpsTotalFrames++;
if(fpsUpdateFramesInterval>0 && fpsTotalFrames%fpsUpdateFramesInterval == 0) {
final long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
fpsLastPeriod = now - fpsLastUpdateTime;
- fpsLastPeriod = Math.max(fpsLastPeriod, 1); // div 0
- fpsLast = ( (float)fpsUpdateFramesInterval * 1000f ) / ( (float) fpsLastPeriod ) ;
-
+ fpsLastPeriod = Math.max(fpsLastPeriod, 1); // div 0
+ fpsLast = ( (float)fpsUpdateFramesInterval * 1000f ) / ( (float) fpsLastPeriod ) ;
+
fpsTotalDuration = now - fpsStartTime;
fpsTotalDuration = Math.max(fpsTotalDuration, 1); // div 0
fpsTotal= ( (float)fpsTotalFrames * 1000f ) / ( (float) fpsTotalDuration ) ;
-
+
if(null != fpsOutputStream) {
fpsOutputStream.println(toString());
}
-
+
fpsLastUpdateTime = now;
}
}
-
+
public StringBuilder toString(StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
@@ -81,22 +81,22 @@ public class FPSCounterImpl implements FPSCounter {
String fpsLastS = String.valueOf(fpsLast);
fpsLastS = fpsLastS.substring(0, fpsLastS.indexOf('.') + 2);
String fpsTotalS = String.valueOf(fpsTotal);
- fpsTotalS = fpsTotalS.substring(0, fpsTotalS.indexOf('.') + 2);
+ fpsTotalS = fpsTotalS.substring(0, fpsTotalS.indexOf('.') + 2);
sb.append(fpsTotalDuration/1000 +" s: "+ fpsUpdateFramesInterval+" f / "+ fpsLastPeriod+" ms, " + fpsLastS+" fps, "+ fpsLastPeriod/fpsUpdateFramesInterval+" ms/f; "+
"total: "+ fpsTotalFrames+" f, "+ fpsTotalS+ " fps, "+ fpsTotalDuration/fpsTotalFrames+" ms/f");
return sb;
}
-
+
public String toString() {
return toString(null).toString();
}
-
+
public final synchronized void setUpdateFPSFrames(int frames, PrintStream out) {
fpsUpdateFramesInterval = frames;
fpsOutputStream = out;
resetFPSCounter();
}
-
+
public final synchronized void resetFPSCounter() {
fpsStartTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); // overwrite startTime to real init one
fpsLastUpdateTime = fpsStartTime;
@@ -109,9 +109,9 @@ public class FPSCounterImpl implements FPSCounter {
public final synchronized int getUpdateFPSFrames() {
return fpsUpdateFramesInterval;
}
-
- public final synchronized long getFPSStartTime() {
- return fpsStartTime;
+
+ public final synchronized long getFPSStartTime() {
+ return fpsStartTime;
}
public final synchronized long getLastFPSUpdateTime() {
@@ -121,20 +121,20 @@ public class FPSCounterImpl implements FPSCounter {
public final synchronized long getLastFPSPeriod() {
return fpsLastPeriod;
}
-
+
public final synchronized float getLastFPS() {
return fpsLast;
}
-
- public final synchronized int getTotalFPSFrames() {
- return fpsTotalFrames;
+
+ public final synchronized int getTotalFPSFrames() {
+ return fpsTotalFrames;
}
- public final synchronized long getTotalFPSDuration() {
- return fpsTotalDuration;
+ public final synchronized long getTotalFPSDuration() {
+ return fpsTotalDuration;
}
-
+
public final synchronized float getTotalFPS() {
return fpsTotal;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
index f8b453555..bb2983399 100644
--- a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
+++ b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.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 java.io.PrintStream;
@@ -56,7 +56,7 @@ import com.jogamp.opengl.GLStateKeeper;
/**
* Abstract common code for GLAutoDrawable implementations.
- *
+ *
* @see GLAutoDrawable
* @see GLAutoDrawableDelegate
* @see GLPBufferImpl
@@ -64,10 +64,10 @@ import com.jogamp.opengl.GLStateKeeper;
*/
public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeeper, FPSCounter {
public static final boolean DEBUG = GLDrawableImpl.DEBUG;
-
+
protected final GLDrawableHelper helper = new GLDrawableHelper();
protected final FPSCounterImpl fpsCounter = new FPSCounterImpl();
-
+
protected volatile GLDrawableImpl drawable; // volatile: avoid locking for read-only access
protected GLContextImpl context;
protected boolean preserveGLELSAtDestroy;
@@ -79,9 +79,9 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
protected volatile boolean sendDestroy = false; // volatile: maybe written by WindowManager thread w/o locking
/**
- * @param drawable upstream {@link GLDrawableImpl} instance,
+ * @param drawable upstream {@link GLDrawableImpl} instance,
* may be null for lazy initialization
- * @param context upstream {@link GLContextImpl} instance,
+ * @param context upstream {@link GLContextImpl} instance,
* may not have been made current (created) yet,
* may not be associated w/ drawable yet,
* may be null for lazy initialization
@@ -100,19 +100,19 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
if(null != context && null != drawable) {
context.setGLDrawable(drawable, false);
}
- resetFPSCounter();
+ resetFPSCounter();
}
-
- /** Returns the recursive lock object of the upstream implementation, which synchronizes multithreaded access on top of {@link NativeSurface#lockSurface()}. */
+
+ /** Returns the recursive lock object of the upstream implementation, which synchronizes multithreaded access on top of {@link NativeSurface#lockSurface()}. */
protected abstract RecursiveLock getLock();
@Override
public final GLStateKeeper.Listener setGLStateKeeperListener(Listener l) {
final GLStateKeeper.Listener pre = glStateKeeperListener;
glStateKeeperListener = l;
- return pre;
+ return pre;
}
-
+
@Override
public final boolean preserveGLStateAtDestroy(boolean value) {
final boolean res = isGLStatePreservationSupported() ? true : false;
@@ -125,10 +125,10 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
return res;
}
-
+
@Override
public boolean isGLStatePreservationSupported() { return false; }
-
+
@Override
public final GLEventListenerState getPreservedGLState() {
return glels;
@@ -140,20 +140,20 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
glels = null;
return r;
}
-
+
/**
* Pulls the {@link GLEventListenerState} from this {@link GLAutoDrawable}.
- *
+ *
* @return true if the {@link GLEventListenerState} is pulled successfully from this {@link GLAutoDrawable},
* otherwise false.
- *
+ *
* @throws IllegalStateException if the {@link GLEventListenerState} is already pulled
- *
+ *
* @see #pushGLEventListenerState()
*/
protected final boolean pullGLEventListenerState() throws IllegalStateException {
if( null != glels ) {
- throw new IllegalStateException("GLEventListenerState already pulled");
+ throw new IllegalStateException("GLEventListenerState already pulled");
}
if( null != context && context.isCreated() ) {
if( null!= glStateKeeperListener) {
@@ -164,14 +164,14 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
return false;
}
-
+
/**
* Pushes a previously {@link #pullGLEventListenerState() pulled} {@link GLEventListenerState} to this {@link GLAutoDrawable}.
- *
- * @return true if the {@link GLEventListenerState} was previously {@link #pullGLEventListenerState() pulled}
+ *
+ * @return true if the {@link GLEventListenerState} was previously {@link #pullGLEventListenerState() pulled}
* and is pushed successfully to this {@link GLAutoDrawable},
* otherwise false.
- *
+ *
* @see #pullGLEventListenerState()
*/
protected final boolean pushGLEventListenerState() {
@@ -180,12 +180,12 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
glels = null;
if( null!= glStateKeeperListener) {
glStateKeeperListener.glStateRestored(this);
- }
+ }
return true;
}
- return false;
+ return false;
}
-
+
/** Default implementation to handle repaint events from the windowing system */
protected final void defaultWindowRepaintOp() {
final GLDrawable _drawable = drawable;
@@ -195,7 +195,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
}
}
-
+
/** Default implementation to handle resize events from the windowing system. All required locks are being claimed. */
protected final void defaultWindowResizedOp(int newWidth, int newHeight) throws NativeWindowException, GLException {
GLDrawableImpl _drawable = drawable;
@@ -210,7 +210,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
try {
final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, newWidth, newHeight);
if(_drawable != _drawableNew) {
- // write back
+ // write back
_drawable = _drawableNew;
drawable = _drawableNew;
}
@@ -226,15 +226,15 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
}
}
-
- /**
+
+ /**
* Default implementation to handle destroy notifications from the windowing system.
- *
+ *
*
- * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol}
+ * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol}
* or {@link WindowClosingMode#DISPOSE_ON_CLOSE} is enabled (default),
* a thread safe destruction is being induced.
- *
+ *
*/
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