aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r--src/jogl/classes/jogamp/opengl/FPSCounterImpl.java137
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java178
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextLock.java157
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java266
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableHelper.java58
-rw-r--r--src/jogl/classes/jogamp/opengl/GLPbufferImpl.java15
-rw-r--r--src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java79
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLContext.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/README.txt110
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java52
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/ActiveRegion.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUface.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUmesh.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java50
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUvertex.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java30
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java20
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLContext.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java28
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java122
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java29
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java30
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java46
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java33
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java2
51 files changed, 1042 insertions, 662 deletions
diff --git a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
new file mode 100644
index 000000000..96d62fbb3
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
@@ -0,0 +1,137 @@
+/**
+ * Copyright 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:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl;
+
+import java.io.PrintStream;
+import javax.media.opengl.FPSCounter;
+
+/**
+ * Default implementation of FPSCounter to be used for FPSCounter implementing renderer.
+ */
+public class FPSCounterImpl implements FPSCounter {
+ private int fpsUpdateFramesInterval;
+ private PrintStream fpsOutputStream ;
+ 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.<br>
+ *
+ * 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 = System.currentTimeMillis();
+ fpsLastPeriod = now - fpsLastUpdateTime;
+ 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();
+ }
+ String fpsLastS = String.valueOf(fpsLast);
+ fpsLastS = fpsLastS.substring(0, fpsLastS.indexOf('.') + 2);
+ String fpsTotalS = String.valueOf(fpsTotal);
+ 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 = System.currentTimeMillis(); // overwrite startTime to real init one
+ fpsLastUpdateTime = fpsStartTime;
+ fpsLastPeriod = 0;
+ fpsTotalFrames = 0;
+ fpsLast = 0f; fpsTotal = 0f;
+ }
+
+ public final synchronized int getUpdateFPSFrames() {
+ return fpsUpdateFramesInterval;
+ }
+
+ public final synchronized long getFPSStartTime() {
+ return fpsStartTime;
+ }
+
+ public final synchronized long getLastFPSUpdateTime() {
+ return fpsLastUpdateTime;
+ }
+
+ public final synchronized long getLastFPSPeriod() {
+ return fpsLastPeriod;
+ }
+
+ public final synchronized float getLastFPS() {
+ return fpsLast;
+ }
+
+ public final synchronized int getTotalFPSFrames() {
+ return fpsTotalFrames;
+ }
+
+ public final synchronized long getTotalFPSDuration() {
+ return fpsTotalDuration;
+ }
+
+ public final synchronized float getTotalFPS() {
+ return fpsTotal;
+ }
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
index 15e3affee..fc8be95e9 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
@@ -107,17 +107,7 @@ public class GLBufferSizeTracker {
int target, GL caller, long size) {
// Need to do some similar queries to getBufferSize below
int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
- boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
- if (valid) {
- if (buffer == 0) {
- // FIXME: this really should not happen if we know what's
- // going on. Very likely there is an OpenGL error in the
- // application if we get here. Could silently return 0, but it
- // seems better to get an early warning that something is
- // wrong.
- throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
- Integer.toHexString(target));
- }
+ if (buffer != 0) {
setDirectStateBufferSize(buffer, caller, size);
}
// We don't know the current buffer state. Note that the buffer
@@ -135,18 +125,8 @@ public class GLBufferSizeTracker {
GL caller) {
// See whether we know what buffer is currently bound to the given
// state
- int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
- boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
- if (valid) {
- if (0 == buffer) {
- // FIXME: this really should not happen if we know what's
- // going on. Very likely there is an OpenGL error in the
- // application if we get here. Could silently return 0, but it
- // seems better to get an early warning that something is
- // wrong.
- throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
- Integer.toHexString(target));
- }
+ final int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
+ if (0 != buffer) {
return getBufferSizeImpl(target, buffer, caller);
}
// We don't know what's going on in this case; query the GL for an answer
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
index d028bf98d..5a31431d8 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
@@ -136,14 +136,6 @@ public class GLBufferStateTracker {
return value;
}
- /** Indicates whether the binding state for the specified target is
- currently known, ie it could be bound or not but it must be tracked.<br>
- Should be called after getBoundBufferObject()
- because that method may change the answer for a given target. */
- public boolean isBoundBufferObjectKnown(int target) {
- return 0 < bindingMap.get(target) ;
- }
-
/** Clears out the known/unknown state of the various buffer object
binding states. These will be refreshed later on an as-needed
basis. This is called by the implementations of
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 9361fb0f9..6128b30b4 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -41,11 +41,13 @@
package jogamp.opengl;
import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
import java.util.HashMap;
import java.util.Map;
import com.jogamp.common.os.DynamicLookupHelper;
import com.jogamp.common.util.ReflectionUtil;
+import com.jogamp.common.util.locks.RecursiveLock;
import com.jogamp.gluegen.runtime.FunctionAddressResolver;
import com.jogamp.gluegen.runtime.ProcAddressTable;
import com.jogamp.gluegen.runtime.opengl.GLExtensionNames;
@@ -57,6 +59,8 @@ import javax.media.nativewindow.NativeSurface;
import javax.media.opengl.GL;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDebugListener;
+import javax.media.opengl.GLDebugMessage;
import javax.media.opengl.GLDrawable;
import javax.media.opengl.GLException;
import javax.media.opengl.GLPipelineFactory;
@@ -65,7 +69,8 @@ import javax.media.opengl.GLProfile;
public abstract class GLContextImpl extends GLContext {
public static final boolean DEBUG = Debug.debug("GLContext");
- protected GLContextLock lock = new GLContextLock();
+ // RecursiveLock maintains a queue of waiting Threads, ensuring the longest waiting thread will be notified at unlock.
+ protected RecursiveLock lock = new RecursiveLock();
/**
* Context full qualified name: display_type + display_connection + major + minor + ctp.
@@ -73,6 +78,8 @@ public abstract class GLContextImpl extends GLContext {
*/
private String contextFQN;
+ private int additionalCtxCreationFlags;
+
// Cache of the functions that are available to be called at the current
// moment in time
protected ExtensionAvailabilityCache extensionAvailability;
@@ -85,22 +92,23 @@ public abstract class GLContextImpl extends GLContext {
private GLBufferSizeTracker bufferSizeTracker; // Singleton - Set by GLContextShareSet
private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
private GLStateTracker glStateTracker = new GLStateTracker();
-
+ private GLDebugMessageHandler glDebugHandler = null;
+
protected GLDrawableImpl drawable;
protected GLDrawableImpl drawableRead;
protected GL gl;
protected static final Object mappedContextTypeObjectLock;
- protected static final HashMap mappedExtensionAvailabilityCache;
- protected static final HashMap mappedGLProcAddress;
- protected static final HashMap mappedGLXProcAddress;
+ protected static final HashMap<String, ExtensionAvailabilityCache> mappedExtensionAvailabilityCache;
+ protected static final HashMap<String, ProcAddressTable> mappedGLProcAddress;
+ protected static final HashMap<String, ProcAddressTable> mappedGLXProcAddress;
static {
mappedContextTypeObjectLock = new Object();
- mappedExtensionAvailabilityCache = new HashMap();
- mappedGLProcAddress = new HashMap();
- mappedGLXProcAddress = new HashMap();
+ mappedExtensionAvailabilityCache = new HashMap<String, ExtensionAvailabilityCache>();
+ mappedGLProcAddress = new HashMap<String, ProcAddressTable>();
+ mappedGLXProcAddress = new HashMap<String, ProcAddressTable>();
}
public GLContextImpl(GLDrawableImpl drawable, GLContext shareWith) {
@@ -113,6 +121,8 @@ public abstract class GLContextImpl extends GLContext {
this.drawable = drawable;
this.drawableRead = drawable;
+
+ this.glDebugHandler = new GLDebugMessageHandler(this);
}
protected void resetStates() {
@@ -137,6 +147,7 @@ public abstract class GLContextImpl extends GLContext {
glProcAddressTable = null;
gl = null;
contextFQN = null;
+ additionalCtxCreationFlags = 0;
super.resetStates();
}
@@ -145,7 +156,7 @@ public abstract class GLContextImpl extends GLContext {
if(null!=read && drawable!=read && !isGLReadDrawableAvailable()) {
throw new GLException("GL Read Drawable not available");
}
- boolean lockHeld = lock.isHeld();
+ boolean lockHeld = lock.isOwner();
if(lockHeld) {
release();
}
@@ -185,19 +196,36 @@ public abstract class GLContextImpl extends GLContext {
// This is only needed for Mac OS X on-screen contexts
protected void update() throws GLException { }
+ boolean lockFailFast = true;
+ Object lockFailFastSync = new Object();
+
public boolean isSynchronized() {
- return !lock.getFailFastMode();
+ synchronized (lockFailFastSync) {
+ return !lockFailFast;
+ }
}
public void setSynchronized(boolean isSynchronized) {
- lock.setFailFastMode(!isSynchronized);
+ synchronized (lockFailFastSync) {
+ lockFailFast = !isSynchronized;
+ }
}
+ private final void lockConsiderFailFast() {
+ synchronized (lockFailFastSync) {
+ if(lockFailFast && lock.isLockedByOtherThread()) {
+ throw new GLException("Error: Attempt to make context current on thread " + Thread.currentThread() +
+ " which is already current on thread " + lock.getOwner());
+ }
+ }
+ lock.lock();
+ }
+
public abstract Object getPlatformGLExtensions();
// Note: the surface is locked within [makeCurrent .. swap .. release]
public void release() throws GLException {
- if (!lock.isHeld()) {
+ if ( !lock.isOwner() ) {
throw new GLException("Context not current on current thread");
}
setCurrent(null);
@@ -213,14 +241,17 @@ public abstract class GLContextImpl extends GLContext {
protected abstract void releaseImpl() throws GLException;
public final void destroy() {
- if (lock.isHeld()) {
- // release current context
+ if ( lock.isOwner() ) {
+ // release current context
+ if(null != glDebugHandler) {
+ glDebugHandler.enable(false);
+ }
release();
}
// Must hold the lock around the destroy operation to make sure we
// don't destroy the context out from under another thread rendering to it
- lock.lock();
+ lockConsiderFailFast();
try {
/* FIXME: refactor dependence on Java 2D / JOGL bridge
if (tracker != null) {
@@ -248,6 +279,7 @@ public abstract class GLContextImpl extends GLContext {
try {
destroyImpl();
contextHandle = 0;
+ glDebugHandler = null;
GLContextShareSet.contextDestroyed(this);
} finally {
drawable.unlockSurface();
@@ -345,9 +377,10 @@ public abstract class GLContextImpl extends GLContext {
if (null == getGLDrawable().getChosenGLCapabilities()) {
throw new GLException("drawable has no chosen GLCapabilities: "+getGLDrawable());
}
+ additionalCtxCreationFlags |= DEBUG_GL ? GLContext.CTX_OPTION_DEBUG : 0 ;
}
- lock.lock();
+ lockConsiderFailFast();
int res = 0;
try {
res = makeCurrentLocking();
@@ -366,6 +399,7 @@ public abstract class GLContextImpl extends GLContext {
if (res == CONTEXT_NOT_CURRENT) {
lock.unlock();
} else {
+ setCurrent(this);
if(res == CONTEXT_CURRENT_NEW) {
// check if the drawable's and the GL's GLProfile are equal
// throws an GLException if not
@@ -373,12 +407,13 @@ public abstract class GLContextImpl extends GLContext {
if(DEBUG_GL) {
gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, gl, null) );
+ glDebugHandler.addListener(new GLDebugMessageHandler.StdErrGLDebugListener());
}
if(TRACE_GL) {
gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, gl, new Object[] { System.err } ) );
}
+ glDebugHandler.init(0 != (additionalCtxCreationFlags & GLContext.CTX_OPTION_DEBUG));
}
- setCurrent(this);
/* FIXME: refactor dependence on Java 2D / JOGL bridge
@@ -501,13 +536,13 @@ public abstract class GLContextImpl extends GLContext {
* @see #createContextARBImpl
* @see #destroyContextARBImpl
*/
- protected final long createContextARB(long share, boolean direct,
- int major[], int minor[], int ctp[])
+ protected final long createContextARB(long share, boolean direct)
{
AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
AbstractGraphicsDevice device = config.getScreen().getDevice();
GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
GLProfile glp = glCaps.getGLProfile();
+ GLProfile glpImpl = GLProfile.get(glp.getImplName());
if (DEBUG) {
System.err.println(getThreadName() + ": !!! createContextARB: mappedVersionsAvailableSet("+device.getConnection()+"): "+
@@ -519,15 +554,15 @@ public abstract class GLContextImpl extends GLContext {
}
int reqMajor;
- if(glp.isGL4()) {
+ if(glpImpl.isGL4()) {
reqMajor=4;
- } else if (glp.isGL3()) {
+ } else if (glpImpl.isGL3()) {
reqMajor=3;
- } else /* if (glp.isGL2()) */ {
+ } else /* if (glpImpl.isGL2()) */ {
reqMajor=2;
}
- boolean compat = glp.isGL2(); // incl GL3bc and GL4bc
+ boolean compat = glpImpl.isGL2(); // incl GL3bc and GL4bc
int _major[] = { 0 };
int _minor[] = { 0 };
int _ctp[] = { 0 };
@@ -535,6 +570,7 @@ public abstract class GLContextImpl extends GLContext {
if( GLContext.getAvailableGLVersion(device, reqMajor, compat?CTX_PROFILE_COMPAT:CTX_PROFILE_CORE,
_major, _minor, _ctp)) {
+ _ctp[0] |= additionalCtxCreationFlags;
_ctx = createContextARBImpl(share, direct, _ctp[0], _major[0], _minor[0]);
if(0!=_ctx) {
setGLFunctionAvailability(true, _major[0], _minor[0], _ctp[0]);
@@ -545,17 +581,16 @@ public abstract class GLContextImpl extends GLContext {
private final void mapGLVersions(AbstractGraphicsDevice device) {
synchronized (GLContext.deviceVersionAvailable) {
- createContextARBMapVersionsAvailable(4, false /* core */); // GL4
createContextARBMapVersionsAvailable(4, true /* compat */); // GL4bc
- createContextARBMapVersionsAvailable(3, false /* core */); // GL3
+ createContextARBMapVersionsAvailable(4, false /* core */); // GL4
createContextARBMapVersionsAvailable(3, true /* compat */); // GL3bc
+ createContextARBMapVersionsAvailable(3, false /* core */); // GL3
createContextARBMapVersionsAvailable(2, true /* compat */); // GL2
GLContext.setAvailableGLVersionsSet(device);
}
}
- private final void createContextARBMapVersionsAvailable(int reqMajor, boolean compat)
- {
+ private final void createContextARBMapVersionsAvailable(int reqMajor, boolean compat) {
resetStates();
long _context;
@@ -765,14 +800,14 @@ public abstract class GLContextImpl extends GLContext {
name. Currently this is only used to map "glAllocateMemoryNV" and
associated routines to wglAllocateMemoryNV / glXAllocateMemoryNV. */
protected String mapToRealGLFunctionName(String glFunctionName) {
- Map/*<String, String>*/ map = getFunctionNameMap();
- String lookup = ( null != map ) ? (String) map.get(glFunctionName) : null;
+ Map<String, String> map = getFunctionNameMap();
+ String lookup = ( null != map ) ? map.get(glFunctionName) : null;
if (lookup != null) {
return lookup;
}
return glFunctionName;
}
- protected abstract Map/*<String, String>*/ getFunctionNameMap() ;
+ protected abstract Map<String, String> getFunctionNameMap() ;
/** Maps the given "platform-independent" extension name to a real
function name. Currently this is only used to map
@@ -780,14 +815,14 @@ public abstract class GLContextImpl extends GLContext {
"GL_ARB_pixel_format" to "WGL_ARB_pixel_format/n.a."
*/
protected String mapToRealGLExtensionName(String glExtensionName) {
- Map/*<String, String>*/ map = getExtensionNameMap();
- String lookup = ( null != map ) ? (String) map.get(glExtensionName) : null;
+ Map<String, String> map = getExtensionNameMap();
+ String lookup = ( null != map ) ? map.get(glExtensionName) : null;
if (lookup != null) {
return lookup;
}
return glExtensionName;
}
- protected abstract Map/*<String, String>*/ getExtensionNameMap() ;
+ protected abstract Map<String, String> getExtensionNameMap() ;
/** Helper routine which resets a ProcAddressTable generated by the
GLEmitter by looking up anew all of its function pointers. */
@@ -841,7 +876,7 @@ public abstract class GLContextImpl extends GLContext {
ProcAddressTable table = null;
synchronized(mappedContextTypeObjectLock) {
- table = (ProcAddressTable) mappedGLProcAddress.get( contextFQN );
+ table = mappedGLProcAddress.get( contextFQN );
if(null != table && !verifyInstance(gl.getGLProfile(), "ProcAddressTable", table)) {
throw new InternalError("GLContext GL ProcAddressTable mapped key("+contextFQN+") -> "+
table.getClass().getName()+" not matching "+gl.getGLProfile().getGLImplBaseClassName());
@@ -877,7 +912,7 @@ public abstract class GLContextImpl extends GLContext {
//
ExtensionAvailabilityCache eCache;
synchronized(mappedContextTypeObjectLock) {
- eCache = (ExtensionAvailabilityCache) mappedExtensionAvailabilityCache.get( contextFQN );
+ eCache = mappedExtensionAvailabilityCache.get( contextFQN );
}
if(null != eCache) {
extensionAvailability = eCache;
@@ -1046,7 +1081,78 @@ public abstract class GLContextImpl extends GLContext {
//
public boolean hasWaiters() {
- return lock.hasWaiters();
+ return lock.getWaitingThreadQueueSize()>0;
+ }
+
+ //---------------------------------------------------------------------------
+ // GL_ARB_debug_output, GL_AMD_debug_output helpers
+ //
+
+ public final String getGLDebugMessageExtension() {
+ return glDebugHandler.getExtension();
+ }
+
+ public final boolean isGLDebugMessageEnabled() {
+ return glDebugHandler.isEnabled();
+ }
+
+ public int getContextCreationFlags() {
+ return additionalCtxCreationFlags;
}
+ public void setContextCreationFlags(int flags) {
+ if(!isCreated()) {
+ additionalCtxCreationFlags = flags & GLContext.CTX_OPTION_DEBUG;
+ }
+ }
+
+ public void enableGLDebugMessage(boolean enable) throws GLException {
+ if(!isCreated()) {
+ if(enable) {
+ additionalCtxCreationFlags |= GLContext.CTX_OPTION_DEBUG;
+ } else {
+ additionalCtxCreationFlags &= ~GLContext.CTX_OPTION_DEBUG;
+ }
+ } else if(0 != (additionalCtxCreationFlags & GLContext.CTX_OPTION_DEBUG) &&
+ null != getGLDebugMessageExtension()) {
+ glDebugHandler.enable(enable);
+ }
+ }
+
+ public void addGLDebugListener(GLDebugListener listener) {
+ glDebugHandler.addListener(listener);
+ }
+
+ public void removeGLDebugListener(GLDebugListener listener) {
+ glDebugHandler.removeListener(listener);
+ }
+
+ public int getGLDebugListenerSize() {
+ return glDebugHandler.listenerSize();
+ }
+
+ public void glDebugMessageControl(int source, int type, int severity, int count, IntBuffer ids, boolean enabled) {
+ if(glDebugHandler.isExtensionARB()) {
+ gl.getGL2GL3().glDebugMessageControlARB(source, type, severity, count, ids, enabled);
+ } else if(glDebugHandler.isExtensionAMD()) {
+ gl.getGL2GL3().glDebugMessageEnableAMD(GLDebugMessage.translateARB2AMDCategory(source, type), severity, count, ids, enabled);
+ }
+ }
+
+ public void glDebugMessageControl(int source, int type, int severity, int count, int[] ids, int ids_offset, boolean enabled) {
+ if(glDebugHandler.isExtensionARB()) {
+ gl.getGL2GL3().glDebugMessageControlARB(source, type, severity, count, ids, ids_offset, enabled);
+ } else if(glDebugHandler.isExtensionAMD()) {
+ gl.getGL2GL3().glDebugMessageEnableAMD(GLDebugMessage.translateARB2AMDCategory(source, type), severity, count, ids, ids_offset, enabled);
+ }
+ }
+
+ public void glDebugMessageInsert(int source, int type, int id, int severity, int length, String buf) {
+ if(glDebugHandler.isExtensionARB()) {
+ gl.getGL2GL3().glDebugMessageInsertARB(source, type, id, severity, length, buf);
+ } else if(glDebugHandler.isExtensionAMD()) {
+ if(0>length) { length = 0; }
+ gl.getGL2GL3().glDebugMessageInsertAMD(GLDebugMessage.translateARB2AMDCategory(source, type), severity, id, length, buf);
+ }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextLock.java b/src/jogl/classes/jogamp/opengl/GLContextLock.java
deleted file mode 100644
index f725508d8..000000000
--- a/src/jogl/classes/jogamp/opengl/GLContextLock.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * 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
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * 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.
- */
-
-package jogamp.opengl;
-
-import javax.media.opengl.*;
-
-/** Implements the makeCurrent / release locking behavior of the
- GLContext class. When "fail fast mode" is enabled, attempts to
- lock the same GLContextLock on more than one thread cause
- GLException to be raised. This lock is not recursive. Attempts to
- lock it more than once on a given thread will cause GLException to
- be raised. */
-
-public class GLContextLock {
- protected static final boolean DEBUG = GLContextImpl.DEBUG;
-
- static class SyncData {
- boolean failFastMode = true;
- Thread owner = null;
- int waiters = 0;
- Exception lockedStack = null; // only enabled if DEBUG
- }
- private SyncData sdata = new SyncData(); // synchronized (flow/mem) mutable access
-
- /** Locks this GLContextLock on the current thread. If fail fast
- mode is enabled and the GLContextLock is already owned by
- another thread, throws GLException. */
- public final void lock() throws GLException {
- synchronized(sdata) {
- Thread current = Thread.currentThread();
- if (sdata.owner == null) {
- sdata.owner = current;
- if(DEBUG) {
- sdata.lockedStack = new Exception("Error: Previously made current (1) by "+sdata.owner+", lock: "+this);
- }
- } else if (sdata.owner != current) {
- while (sdata.owner != null) {
- if (sdata.failFastMode) {
- if(null!=sdata.lockedStack) {
- sdata.lockedStack.printStackTrace();
- }
- throw new GLException("Error: Attempt to make context current on thread " + current +
- " which is already current on thread " + sdata.owner);
- } else {
- try {
- ++sdata.waiters;
- sdata.wait();
- } catch (InterruptedException e) {
- throw new GLException(e);
- } finally {
- --sdata.waiters;
- }
- }
- }
- sdata.owner = current;
- if(DEBUG) {
- sdata.lockedStack = new Exception("Previously made current (2) by "+sdata.owner+", lock: "+this);
- }
- } else {
- throw new GLException("Attempt to make the same context current twice on thread " + current);
- }
- }
- }
-
- /** Unlocks this GLContextLock. */
- public final void unlock() throws GLException {
- synchronized (sdata) {
- Thread current = Thread.currentThread();
- if (sdata.owner == current) {
- sdata.owner = null;
- sdata.lockedStack = null;
- // Assuming notify() implementation weaks up the longest waiting thread, to avoid starvation.
- // Otherwise we would need to have a Thread queue implemented, using sleep(timeout) and interrupt.
- sdata.notify();
- } else {
- if (sdata.owner != null) {
- throw new GLException("Attempt by thread " + current +
- " to release context owned by thread " + sdata.owner);
- } else {
- throw new GLException("Attempt by thread " + current +
- " to release unowned context");
- }
- }
- }
- }
-
- /** Indicates whether this lock is held by the current thread. */
- public final boolean isHeld() {
- synchronized(sdata) {
- return (Thread.currentThread() == sdata.owner);
- }
- }
-
- public final void setFailFastMode(boolean onOrOff) {
- synchronized(sdata) {
- sdata.failFastMode = onOrOff;
- }
- }
-
- public final boolean getFailFastMode() {
- synchronized(sdata) {
- return sdata.failFastMode;
- }
- }
-
- public final boolean hasWaiters() {
- synchronized(sdata) {
- return (0 != sdata.waiters);
- }
- }
-
- /** holding the owners stack trace when lock is acquired and DEBUG is true */
- public final Exception getLockedStack() {
- synchronized(sdata) {
- return sdata.lockedStack;
- }
- }
-
-}
diff --git a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
new file mode 100644
index 000000000..f67c916ea
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
@@ -0,0 +1,266 @@
+/**
+ * Copyright 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:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl;
+
+import java.util.ArrayList;
+
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.opengl.GL2GL3;
+import javax.media.opengl.GLDebugListener;
+import javax.media.opengl.GLDebugMessage;
+import javax.media.opengl.GLException;
+
+import com.jogamp.gluegen.runtime.ProcAddressTable;
+import jogamp.opengl.gl4.GL4bcProcAddressTable;
+
+/**
+ * The GLDebugMessageHandler, handling <i>GL_ARB_debug_output</i> or <i>GL_AMD_debug_output</i>
+ * debug messages.<br>
+ *
+ * <p>An instance must be bound to the current thread's GLContext to achieve thread safety.</p>
+ *
+ * <p>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.</p>
+ *
+ * <p>In case no <i>GL_ARB_debug_output</i> is available, but <i>GL_AMD_debug_output</i>,
+ * the messages are translated to <i>ARB</i> {@link GLDebugMessage}, using {@link GLDebugMessage#translateAMDEvent(javax.media.opengl.GLContext, long, int, int, int, String)}.</p>
+ */
+public class GLDebugMessageHandler {
+ /** Extension <i>GL_ARB_debug_output</i> implementing GLDebugMessage */
+ public static final String GL_ARB_debug_output = "GL_ARB_debug_output".intern();
+
+ /** Extension <i>GL_AMD_debug_output</i> implementing GLDebugMessage */
+ public static final String GL_AMD_debug_output = "GL_AMD_debug_output".intern();
+
+ private static final boolean DEBUG = Debug.debug("GLDebugMessageHandler");
+
+ private static final int EXT_ARB = 1;
+ private static final int EXT_AMD = 2;
+
+ static {
+ if ( !initIDs0() ) {
+ throw new NativeWindowException("Failed to initialize GLDebugMessageHandler jmethodIDs");
+ }
+ }
+
+ private final GLContextImpl ctx;
+ private final ListenerSyncedImplStub<GLDebugListener> listenerImpl;
+
+ // licefycle: init - EOL
+ private String extName;
+ private int extType;
+ private long glDebugMessageCallbackProcAddress;
+ private boolean extAvailable;
+
+ // licefycle: enable - disable/EOL
+ private long handle;
+
+ /**
+ * @param ctx the associated GLContext
+ * @param glDebugExtension chosen extension to use
+ */
+ public GLDebugMessageHandler(GLContextImpl ctx) {
+ this.ctx = ctx;
+ this.listenerImpl = new ListenerSyncedImplStub<GLDebugListener>();
+ this.glDebugMessageCallbackProcAddress = 0;
+ this.extName = null;
+ this.extType = 0;
+ this.extAvailable = false;
+ this.handle = 0;
+ }
+
+ public void init(boolean enable) {
+ init();
+ if(isAvailable()) {
+ enableImpl(enable);
+ }
+ }
+
+ public void init() {
+ ctx.validateCurrent();
+ if( isAvailable()) {
+ return;
+ }
+
+ if( ctx.isExtensionAvailable(GL_ARB_debug_output) ) {
+ extName = GL_ARB_debug_output;
+ extType = EXT_ARB;
+ } else if( ctx.isExtensionAvailable(GL_AMD_debug_output) ) {
+ extName = GL_AMD_debug_output;
+ extType = EXT_AMD;
+ }
+ if(DEBUG) {
+ System.err.println("GLDebugMessageHandler: Using extension: <"+extName+">");
+ }
+
+ if(0 == extType) {
+ if(DEBUG) {
+ System.err.println("GLDebugMessageHandler: No extension available!");
+ }
+ return;
+ }
+
+ final ProcAddressTable procAddressTable = ctx.getGLProcAddressTable();
+ if( procAddressTable instanceof GL4bcProcAddressTable) {
+ final GL4bcProcAddressTable desktopProcAddressTable = (GL4bcProcAddressTable)procAddressTable;
+ switch(extType) {
+ case EXT_ARB:
+ glDebugMessageCallbackProcAddress = desktopProcAddressTable._addressof_glDebugMessageCallbackARB;
+ break;
+ case EXT_AMD:
+ glDebugMessageCallbackProcAddress = desktopProcAddressTable._addressof_glDebugMessageCallbackAMD;
+ break;
+ }
+ } else {
+ if(DEBUG) {
+ 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 <i>null</i> is returned.
+ */
+ public final String getExtension() {
+ return extName;
+ }
+
+ public final boolean isExtensionARB() {
+ return extName == GL_ARB_debug_output;
+ }
+
+ public final boolean isExtensionAMD() {
+ return extName == GL_AMD_debug_output;
+ }
+
+ /**
+ * @throws GLException if context not current or callback registration failed (enable)
+ */
+ public final void enable(boolean enable) throws GLException {
+ ctx.validateCurrent();
+ if(!isAvailable()) {
+ return;
+ }
+ enableImpl(enable);
+ }
+ final void enableImpl(boolean enable) throws GLException {
+ if(enable) {
+ if(0 == handle) {
+ handle = register0(glDebugMessageCallbackProcAddress, extType);
+ if(0 == handle) {
+ throw new GLException("Failed to register via \"glDebugMessageCallback*\" using "+extName);
+ }
+ }
+ } else {
+ 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 void addListener(GLDebugListener listener) {
+ listenerImpl.addListener(-1, listener);
+ }
+
+ 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) {
+ System.err.println("GLDebugMessageHandler: "+msg);
+ }
+ final ArrayList<GLDebugListener> listeners = listenerImpl.getListeners();
+ for(int i=0; i<listeners.size(); i++) {
+ listeners.get(i).messageSent(msg);
+ }
+ }
+ }
+
+ public static class StdErrGLDebugListener implements GLDebugListener {
+ public void messageSent(GLDebugMessage event) {
+ System.err.println(event);
+ }
+ }
+
+ //
+ // 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);
+ }
+
+ protected final void glDebugMessageAMD(int id, int category, int severity, String msg) {
+ 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/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index d079a1bd1..887e571cc 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -50,12 +50,11 @@ public class GLDrawableHelper {
protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
private static final boolean VERBOSE = Debug.verbose();
private Object listenersLock = new Object();
- private List listeners;
- private volatile boolean listenersIter; // avoid java.util.ConcurrentModificationException
- private Set listenersToBeInit;
+ private ArrayList<GLEventListener> listeners;
+ private HashSet<GLEventListener> listenersToBeInit;
private boolean autoSwapBufferMode;
private Object glRunnablesLock = new Object();
- private ArrayList glRunnables;
+ private ArrayList<GLRunnable> glRunnables;
private GLAnimatorControl animatorCtrl;
public GLDrawableHelper() {
@@ -64,13 +63,12 @@ public class GLDrawableHelper {
public final void reset() {
synchronized(listenersLock) {
- listeners = new ArrayList();
- listenersIter = false;
- listenersToBeInit = new HashSet();
+ listeners = new ArrayList<GLEventListener>();
+ listenersToBeInit = new HashSet<GLEventListener>();
}
autoSwapBufferMode = true;
synchronized(glRunnablesLock) {
- glRunnables = new ArrayList();
+ glRunnables = new ArrayList<GLRunnable>();
}
animatorCtrl = null;
}
@@ -81,7 +79,6 @@ public class GLDrawableHelper {
sb.append("GLAnimatorControl: "+animatorCtrl+", ");
synchronized(listenersLock) {
sb.append("GLEventListeners num "+listeners.size()+" [");
- listenersIter = true;
for (int i=0; i < listeners.size(); i++) {
Object l = listeners.get(i);
sb.append(l);
@@ -89,7 +86,6 @@ public class GLDrawableHelper {
sb.append( !listenersToBeInit.contains(l) );
sb.append("], ");
}
- listenersIter = false;
}
sb.append("]");
return sb.toString();
@@ -107,29 +103,13 @@ public class GLDrawableHelper {
// GLEventListener may be added after context is created,
// hence we earmark initialization for the next display call.
listenersToBeInit.add(listener);
- if(!listenersIter) {
- // fast path
- listeners.add(index, listener);
- } else {
- // copy mode in case this is issued while iterating, eg via init, display, ..
- List newListeners = (List) ((ArrayList) listeners).clone();
- newListeners.add(index, listener);
- listeners = newListeners;
- }
+ listeners.add(index, listener);
}
}
public final void removeGLEventListener(GLEventListener listener) {
synchronized(listenersLock) {
- if(!listenersIter) {
- // fast path
- listeners.remove(listener);
- } else {
- // copy mode in case this is issued while iterating, eg via init, display, ..
- List newListeners = (List) ((ArrayList) listeners).clone();
- newListeners.remove(listener);
- listeners = newListeners;
- }
+ listeners.remove(listener);
listenersToBeInit.remove(listener);
}
}
@@ -141,12 +121,9 @@ public class GLDrawableHelper {
*/
public final void dispose(GLAutoDrawable drawable) {
synchronized(listenersLock) {
- listenersIter = true;
for (int i=0; i < listeners.size(); i++) {
- GLEventListener listener = (GLEventListener) listeners.get(i) ;
- listener.dispose(drawable);
+ listeners.get(i).dispose(drawable);
}
- listenersIter = false;
}
}
@@ -163,9 +140,8 @@ public class GLDrawableHelper {
public final void init(GLAutoDrawable drawable) {
synchronized(listenersLock) {
- listenersIter = true;
for (int i=0; i < listeners.size(); i++) {
- GLEventListener listener = (GLEventListener) listeners.get(i) ;
+ final GLEventListener listener = listeners.get(i) ;
// If make current ctx, 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),
@@ -176,21 +152,18 @@ public class GLDrawableHelper {
throw new GLException("GLEventListener "+listener+" already initialized: "+drawable);
}
}
- listenersIter = false;
}
}
public final void display(GLAutoDrawable drawable) {
synchronized(listenersLock) {
- listenersIter = true;
for (int i=0; i < listeners.size(); i++) {
- GLEventListener listener = (GLEventListener) listeners.get(i) ;
+ final GLEventListener listener = listeners.get(i) ;
// GLEventListener may need to be init,
// in case this one is added after the realization of the GLAutoDrawable
init( listener, drawable, true ) ;
listener.display(drawable);
}
- listenersIter = false;
}
execGLRunnables(drawable);
}
@@ -205,27 +178,25 @@ public class GLDrawableHelper {
public final void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
synchronized(listenersLock) {
- listenersIter = true;
for (int i=0; i < listeners.size(); i++) {
reshape((GLEventListener) listeners.get(i), drawable, x, y, width, height, 0==i);
}
- listenersIter = false;
}
}
private void execGLRunnables(GLAutoDrawable drawable) {
if(glRunnables.size()>0) {
// swap one-shot list asap
- ArrayList _glRunnables = null;
+ ArrayList<GLRunnable> _glRunnables = null;
synchronized(glRunnablesLock) {
if(glRunnables.size()>0) {
_glRunnables = glRunnables;
- glRunnables = new ArrayList();
+ glRunnables = new ArrayList<GLRunnable>();
}
}
if(null!=_glRunnables) {
for (int i=0; i < _glRunnables.size(); i++) {
- ((GLRunnable) _glRunnables.get(i)).run(drawable);
+ _glRunnables.get(i).run(drawable);
}
}
}
@@ -337,6 +308,7 @@ public class GLDrawableHelper {
// Support for recursive makeCurrent() calls as well as calling
// other drawables' display() methods from within another one's
+ // FIXME: re-evaluate due to possible expensive TLS access ?
GLContext lastContext = GLContext.getCurrent();
Runnable lastInitAction = (Runnable) perThreadInitAction.get();
if (lastContext != null) {
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
index 671390fbb..1d52bedbb 100644
--- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
@@ -64,6 +64,7 @@ public class GLPbufferImpl implements GLPbuffer {
private GLContextImpl context;
private GLDrawableHelper drawableHelper = new GLDrawableHelper();
private int floatMode;
+ private int additionalCtxCreationFlags = 0;
public GLPbufferImpl(GLDrawableImpl pbufferDrawable,
GLContext parentContext) {
@@ -177,6 +178,9 @@ public class GLPbufferImpl implements GLPbuffer {
public void setContext(GLContext ctx) {
context=(GLContextImpl)ctx;
+ if(null != context) {
+ context.setContextCreationFlags(additionalCtxCreationFlags);
+ }
}
public GLContext getContext() {
@@ -207,6 +211,17 @@ public class GLPbufferImpl implements GLPbuffer {
invokeGL(swapBuffersAction);
}
+ public void setContextCreationFlags(int flags) {
+ additionalCtxCreationFlags = flags;
+ if(null != context) {
+ context.setContextCreationFlags(additionalCtxCreationFlags);
+ }
+ }
+
+ public int getContextCreationFlags() {
+ return additionalCtxCreationFlags;
+ }
+
public void bindTexture() {
// Doesn't make much sense to try to do this on the event dispatch
// thread given that it has to be called while the context is current
diff --git a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
new file mode 100644
index 000000000..1cde551be
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright 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:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl;
+
+import java.util.ArrayList;
+
+/**
+ * Simple locked listener implementation stub to be used for listener handler,
+ * synchronized on it's instance.
+ *
+ * <p>Utilizing simple locking via synchronized.</p>
+ *
+ * @param <E> The listener type
+ */
+public class ListenerSyncedImplStub<E> {
+ private ArrayList<E> listeners;
+
+ public ListenerSyncedImplStub() {
+ reset();
+ }
+
+ public synchronized final void reset() {
+ listeners = new ArrayList<E>();
+ }
+
+ public synchronized final void destroy() {
+ listeners.clear();
+ listeners = null;
+ }
+
+ public synchronized final int size() {
+ return listeners.size();
+ }
+
+ public synchronized final void addListener(E listener) {
+ addListener(-1, listener);
+ }
+
+ public synchronized final void addListener(int index, E listener) {
+ if(0>index) {
+ index = listeners.size();
+ }
+ listeners.add(index, listener);
+ }
+
+ public synchronized final void removeListener(E listener) {
+ listeners.remove(listener);
+ }
+
+ public final ArrayList<E> getListeners() {
+ return listeners;
+ }
+}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index 864b9583d..dbdfcd5d9 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -76,9 +76,9 @@ public abstract class EGLContext extends GLContextImpl {
return eglExtProcAddressTable;
}
- protected Map/*<String, String>*/ getFunctionNameMap() { return null; }
+ protected Map<String, String> getFunctionNameMap() { return null; }
- protected Map/*<String, String>*/ getExtensionNameMap() { return null; }
+ protected Map<String, String> getExtensionNameMap() { return null; }
public final boolean isGLReadDrawableAvailable() {
return true;
@@ -203,12 +203,12 @@ public abstract class EGLContext extends GLContextImpl {
eglQueryStringInitialized = false;
eglQueryStringAvailable = false;
- EGLExtProcAddressTable table = null;
+ ProcAddressTable table = null;
synchronized(mappedContextTypeObjectLock) {
- table = (EGLExtProcAddressTable) mappedGLXProcAddress.get( key );
+ table = mappedGLXProcAddress.get( key );
}
if(null != table) {
- eglExtProcAddressTable = table;
+ eglExtProcAddressTable = (EGLExtProcAddressTable) table;
if(DEBUG) {
System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable reusing key("+key+") -> "+table.hashCode());
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
index 5eb73cd2e..3f8a76535 100644
--- a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -223,7 +223,7 @@ public class GLUquadricImpl implements GLUquadric {
* GLU.LINE: Quadrics are rendered as a set of lines.
*
* GLU.SILHOUETTE: Quadrics are rendered as a set of lines, except that edges
- * separating coplanar faces will not be drawn.
+ * separating coplanar faces will not be drawn.
*
* GLU.POINT: Quadrics are rendered as a set of points.
*
@@ -234,8 +234,8 @@ public class GLUquadricImpl implements GLUquadric {
}
/**
- * specifies what kind of normals are desired for quadrics.
- * The legal values are as follows:
+ * specifies what kind of normals are desired for quadrics.
+ * The legal values are as follows:
*
* GLU.NONE: No normals are generated.
*
@@ -252,7 +252,7 @@ public class GLUquadricImpl implements GLUquadric {
/**
* specifies what kind of orientation is desired for.
- * The orientation values are as follows:
+ * The orientation values are as follows:
*
* GLU.OUTSIDE: Quadrics are drawn with normals pointing outward.
*
@@ -495,10 +495,10 @@ public class GLUquadricImpl implements GLUquadric {
glNormal3f(gl, 0.0f, 0.0f, -1.0f);
}
}
-
+
da = 2.0f * PI / slices;
dr = (outerRadius - innerRadius) / loops;
-
+
switch (drawStyle) {
case GLU.GLU_FILL:
{
@@ -916,7 +916,7 @@ public class GLUquadricImpl implements GLUquadric {
}
/**
- * draws a sphere of the given radius centered around the origin.
+ * draws a sphere of the given radius centered around the origin.
* The sphere is subdivided around the z axis into slices and along the z axis
* into stacks (similar to lines of longitude and latitude).
*
@@ -1188,7 +1188,7 @@ public class GLUquadricImpl implements GLUquadric {
*/
private void normal3f(GL gl, float x, float y, float z) {
float mag;
-
+
mag = (float)Math.sqrt(x * x + y * y + z * z);
if (mag > 0.00001F) {
x /= mag;
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
index 043edac89..2ef4468e5 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -131,7 +131,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
CArrayOfFloats ps) {
if (output_triangles) {
// TODO code for callback (output_triangles probably indicates callback)
- // System.out.println("TODO curveevaluator.map1f-output_triangles");
+ // System.out.println("TODO curveevaluator.map1f-output_triangles");
} else {
gl.glMap1f(type, ulo, uhi, stride, order, ps.getArray(), ps
.getPointer());
@@ -166,10 +166,10 @@ class GL2CurveEvaluator implements CurveEvaluator {
*/
public void mapgrid1f(int nu, float u1, float u2) {
if (output_triangles) {
- // System.out.println("TODO curveevaluator.mapgrid1f");
+ // System.out.println("TODO curveevaluator.mapgrid1f");
} else
gl.glMapGrid1f(nu, u1, u2);
- // // System.out.println("upravit NU");
+ // // System.out.println("upravit NU");
// gl.glMapGrid1f(50,u1,u2);
}
@@ -189,7 +189,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
*/
if (output_triangles) {
// TODO code for callback
- // System.out.println("TODO openglcurveevaluator.mapmesh1f output_triangles");
+ // System.out.println("TODO openglcurveevaluator.mapmesh1f output_triangles");
} else {
switch (style) {
case Backend.N_MESHFILL:
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
index bc63994cb..155c4f9a9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
@@ -76,10 +76,10 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
if (output_triangles) {
// TODO outp triangles surfaceevaluator bgnmap2f
- // System.out.println("TODO surfaceevaluator.bgnmap2f output triangles");
+ // System.out.println("TODO surfaceevaluator.bgnmap2f output triangles");
} else {
gl.glPushAttrib(GL2.GL_EVAL_BIT);
- // System.out.println("TODO surfaceevaluator.bgnmap2f glgetintegerv");
+ // System.out.println("TODO surfaceevaluator.bgnmap2f glgetintegerv");
}
}
@@ -112,7 +112,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
public void endmap2f() {
// TODO Auto-generated method stub
if (output_triangles) {
- // System.out.println("TODO surfaceevaluator.endmap2f output triangles");
+ // System.out.println("TODO surfaceevaluator.endmap2f output triangles");
} else {
gl.glPopAttrib();
// TODO use LOD
@@ -142,7 +142,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) {
if (output_triangles) {
- // System.out.println("TODO openglsurfaceavaluator.mapgrid2f output_triangles");
+ // System.out.println("TODO openglsurfaceavaluator.mapgrid2f output_triangles");
} else {
gl.glMapGrid2d(nu, u0, u1, nv, v0, v1);
}
@@ -159,7 +159,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
*/
public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) {
if (output_triangles) {
- // System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
+ // System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
} else {
/* //DEBUG - draw control points
this.poradi++;
@@ -199,7 +199,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) {
// TODO Auto-generated method stub
if (output_triangles) {
- // System.out.println("TODO openglsurfaceevaluator.map2f output_triangles");
+ // System.out.println("TODO openglsurfaceevaluator.map2f output_triangles");
} else {
gl.glMap2f(type, ulo, uhi, ustride, uorder, vlo, vhi, vstride,
vorder, pts.getArray(), pts.getPointer());
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
index bd0eaf771..58b565484 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
@@ -442,7 +442,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
// TODO errval ??
if (numTrims > 0) {
- // System.out.println("TODO glunurbs.do_endsurface - numtrims > 0");
+ // System.out.println("TODO glunurbs.do_endsurface - numtrims > 0");
}
subdivider.beginQuilts(new GL2Backend());
@@ -461,7 +461,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
*/
public void do_endcurve() {
// DONE
- // // System.out.println("do_endcurve");
+ // // System.out.println("do_endcurve");
if (inCurve <= 0) {
do_nurbserror(7);
return;
@@ -509,7 +509,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
*/
private void do_nurbserror(int i) {
// TODO nurberror
- // System.out.println("TODO nurbserror " + i);
+ // System.out.println("TODO nurbserror " + i);
}
/**
@@ -527,7 +527,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
*/
private void loadGLMatrices() {
// TODO Auto-generated method stub
- // System.out.println("TODO glunurbs.loadGLMatrices");
+ // System.out.println("TODO glunurbs.loadGLMatrices");
}
/**
@@ -783,7 +783,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
// DONE
O_surface o_surface = new O_surface();
// TODO nuid
- // System.out.println("TODO glunurbs.bgnsurface nuid");
+ // System.out.println("TODO glunurbs.bgnsurface nuid");
thread("do_bgnsurface", o_surface);
}
@@ -800,7 +800,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
*/
private void endtrim() {
// TODO Auto-generated method stub
- // System.out.println("TODO glunurbs.endtrim");
+ // System.out.println("TODO glunurbs.endtrim");
}
/**
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
index 0d04d4cd6..f4ad70193 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
@@ -47,7 +47,7 @@ public class ArcSdirSorter {
*/
public ArcSdirSorter(Subdivider subdivider) {
//TODO
- // System.out.println("TODO arcsdirsorter.constructor");
+ // System.out.println("TODO arcsdirsorter.constructor");
}
/**
@@ -57,7 +57,7 @@ public class ArcSdirSorter {
*/
public void qsort(CArrayOfArcs list, int count) {
// TODO
- // System.out.println("TODO arcsdirsorter.qsort");
+ // System.out.println("TODO arcsdirsorter.qsort");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
index bee98b8c3..be72c53d2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
@@ -46,7 +46,7 @@ public class ArcTdirSorter {
*/
public ArcTdirSorter(Subdivider subdivider) {
// TODO Auto-generated constructor stub
- // System.out.println("TODO arcTsorter.konstruktor");
+ // System.out.println("TODO arcTsorter.konstruktor");
}
/**
* Sorts list of arcs
@@ -55,6 +55,6 @@ public class ArcTdirSorter {
*/
public void qsort(CArrayOfArcs list, int count) {
// TODO Auto-generated method stub
- // System.out.println("TODO arcTsorter.qsort");
+ // System.out.println("TODO arcTsorter.qsort");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
index 2e4d3eb96..bd6311414 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
@@ -72,7 +72,7 @@ public class ArcTesselator {
*/
public void pwl_right(Arc newright, float s, float t1, float t2, float f) {
// TODO Auto-generated method stub
- // System.out.println("TODO arctesselator.pwl_right");
+ // System.out.println("TODO arctesselator.pwl_right");
}
/**
@@ -85,6 +85,6 @@ public class ArcTesselator {
*/
public void pwl_left(Arc newright, float s, float t2, float t1, float f) {
// TODO Auto-generated method stub
- // System.out.println("TODO arctesselator.pwl_left");
+ // System.out.println("TODO arctesselator.pwl_left");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
index 4959f8000..610a19556 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
@@ -188,7 +188,7 @@ public abstract class Backend {
* @param m step in v direction
*/
public void surfmesh(int u, int v, int n, int m) {
- // System.out.println("TODO backend.surfmesh wireframequads");
+ // System.out.println("TODO backend.surfmesh wireframequads");
// TODO wireframequads
surfaceEvaluator.mapmesh2f(NurbsConsts.N_MESHFILL, u, u + n, v, v + m);
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
index b0ff4e6e5..786781723 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
@@ -135,7 +135,7 @@ public class Curve {
stride);
}
if (cullval == Subdivider.CULL_ACCEPT) {
- // System.out.println("TODO curve.Curve-cullval");
+ // System.out.println("TODO curve.Curve-cullval");
// mapdesc.xformCulling(ps,qs.get().order,qs.get().stride,cpts,stride);
}
@@ -145,13 +145,13 @@ public class Curve {
range[2] = range[1] - range[0];
// TODO it is necessary to solve problem with "this" pointer here
if (range[0] != pta[0]) {
- // System.out.println("TODO curve.Curve-range0");
+ // System.out.println("TODO curve.Curve-range0");
// Curve lower=new Curve(this,pta,0);
// lower.next=next;
// this=lower;
}
if (range[1] != ptb[0]) {
- // System.out.println("TODO curve.Curve-range1");
+ // System.out.println("TODO curve.Curve-range1");
// Curve lower=new Curve(this,ptb,0);
}
}
@@ -162,7 +162,7 @@ public class Curve {
*/
public int cullCheck() {
if (cullval == Subdivider.CULL_ACCEPT) {
- // System.out.println("TODO curve.cullval");
+ // System.out.println("TODO curve.cullval");
// cullval=mapdesc.cullCheck(cpts,order,stride);
}
// TODO compute cullval and return the computed value
@@ -189,16 +189,16 @@ public class Curve {
int val = 0;
// mapdesc.project(spts,stride,tmp,tstride,order);
- // System.out.println("TODO curve.getsptepsize mapdesc.project");
+ // System.out.println("TODO curve.getsptepsize mapdesc.project");
if (val == 0) {
setstepsize(mapdesc.maxrate);
} else {
float t = mapdesc.getProperty(NurbsConsts.N_PIXEL_TOLERANCE);
if (mapdesc.isParametricDistanceSampling()) {
- // System.out.println("TODO curve.getstepsize - parametric");
+ // System.out.println("TODO curve.getstepsize - parametric");
} else if (mapdesc.isPathLengthSampling()) {
- // System.out.println("TODO curve.getstepsize - pathlength");
+ // System.out.println("TODO curve.getstepsize - pathlength");
} else {
setstepsize(mapdesc.maxrate);
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
index 5c80ffd30..d9d012606 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
@@ -51,6 +51,6 @@ public class DisplayList {
*/
public void append(Object src, Method m, Object arg) {
// TODO Auto-generated method stub
- // System.out.println("TODO displaylist append");
+ // System.out.println("TODO displaylist append");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
index 4f97b1271..114832a1c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
@@ -366,7 +366,7 @@ public class Knotspec {
break;
default:
// TODO break with copying in general case
- // System.out.println("TODO knotspec.pt_io_copy");
+ // System.out.println("TODO knotspec.pt_io_copy");
break;
}
@@ -388,7 +388,7 @@ public class Knotspec {
if (istransformed) {
p.raisePointerBy(postoffset);
for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
- p.getPointer() + postwidth); p.getPointer() != pend
+ p.getPointer() + postwidth); p.getPointer() != pend
.getPointer(); p.raisePointerBy(poststride))
next.transform(p);
@@ -409,7 +409,7 @@ public class Knotspec {
if (istransformed) {
p.raisePointerBy(postoffset);
for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
- p.getPointer() + postwidth); p.getPointer() != pend
+ p.getPointer() + postwidth); p.getPointer() != pend
.getPointer(); p.raisePointerBy(poststride)) {
kspectotrans.insert(p);
}
@@ -549,8 +549,8 @@ public class Knotspec {
* z.getRelative(0)));
break;
default:
- //no need of default - see previous method and its case statement
- // System.out.println("TODO pt_oo_sum default");
+ //no need of default - see previous method and its case statement
+ // System.out.println("TODO pt_oo_sum default");
break;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
index 89389dea6..aac4dfc52 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
@@ -160,7 +160,7 @@ public class Knotvector {
*/
public void show(String msg) {
// TODO Auto-generated method stub
- // System.out.println("TODO knotvector.show");
+ // System.out.println("TODO knotvector.show");
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
index 8fab114ff..bd5d2db98 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
@@ -349,7 +349,7 @@ public class Mapdesc {
*/
public float getProperty(int tag) {
// TODO Auto-generated method stub
- // System.out.println("TODO mapdesc.getproperty");
+ // System.out.println("TODO mapdesc.getproperty");
return 0;
}
@@ -428,10 +428,10 @@ public class Mapdesc {
* @param outstride output number of control points' coordinates
*/
private void xFormMat(float[][] mat, CArrayOfFloats pts, int order,
- int stride, float[] cp, int outstride) {
+ int stride, float[] cp, int outstride) {
// TODO Auto-generated method stub
- // System.out.println("TODO mapdsc.xformmat ; change cp from float[] to carrayoffloats");
+ // System.out.println("TODO mapdsc.xformmat ; change cp from float[] to carrayoffloats");
if (isrational > 0) {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
index 51c43fca7..a44f2451c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
@@ -49,6 +49,6 @@ public class Patch {
* @param patch
*/
public Patch(Quilt q, float[] pta, float[] ptb, Patch patch) {
- // System.out.println("TODO patch.constructor");
+ // System.out.println("TODO patch.constructor");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
index f60a0cc43..f1e499a28 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
@@ -82,7 +82,7 @@ public class Patchlist {
*/
public Patchlist(Patchlist patchlist, int param, float mid) {
// TODO Auto-generated constructor stub
- // System.out.println("TODO patchlist.konstruktor 2");
+ // System.out.println("TODO patchlist.konstruktor 2");
}
/**
@@ -91,7 +91,7 @@ public class Patchlist {
*/
public int cullCheck() {
// TODO Auto-generated method stub
- // System.out.println("TODO patchlist.cullcheck");
+ // System.out.println("TODO patchlist.cullcheck");
return 0;
}
@@ -99,7 +99,7 @@ public class Patchlist {
* Empty method
*/
public void getstepsize() {
- // System.out.println("TODO patchlist.getsptepsize");
+ // System.out.println("TODO patchlist.getsptepsize");
// TODO Auto-generated method stub
}
@@ -110,7 +110,7 @@ public class Patchlist {
*/
public boolean needsSamplingSubdivision() {
// TODO Auto-generated method stub
- // System.out.println("patchlist.needsSamplingSubdivision");
+ // System.out.println("patchlist.needsSamplingSubdivision");
return false;
}
@@ -121,7 +121,7 @@ public class Patchlist {
*/
public boolean needsSubdivision(int i) {
// TODO Auto-generated method stub
- // System.out.println("TODO patchlist.needsSubdivision");
+ // System.out.println("TODO patchlist.needsSubdivision");
return false;
}
@@ -131,7 +131,7 @@ public class Patchlist {
*/
public boolean needsNonSamplingSubdivision() {
// TODO Auto-generated method stub
- // System.out.println("TODO patchlist.needsNonSamplingSubdivision");
+ // System.out.println("TODO patchlist.needsNonSamplingSubdivision");
return false;
}
@@ -140,6 +140,6 @@ public class Patchlist {
*/
public void bbox() {
// TODO Auto-generated method stub
- // System.out.println("TODO patchlist.bbox");
+ // System.out.println("TODO patchlist.bbox");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
index 6d732a44f..6bea4928c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
@@ -248,7 +248,7 @@ public class Quilt {
*/
public int isCulled() {
if (mapdesc.isCulling()) {
- // System.out.println("TODO quilt.isculled mapdesc.isculling");
+ // System.out.println("TODO quilt.isculled mapdesc.isculling");
return 0;
} else {
return Subdivider.CULL_ACCEPT;
@@ -277,6 +277,6 @@ public class Quilt {
*/
public void findRates(Flist sbrkpts, Flist tbrkpts, float[] rate) {
// TODO Auto-generated method stub
- // System.out.println("TODO quilt.findrates");
+ // System.out.println("TODO quilt.findrates");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/README.txt b/src/jogl/classes/jogamp/opengl/glu/nurbs/README.txt
index 89630c71e..7f80e568c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/README.txt
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/README.txt
@@ -1,59 +1,59 @@
Unimplemented functionality
- - tesselation and callbacks
- - trimming
- - setting NURBS properties (-> sampling etc.)
+ - tesselation and callbacks
+ - trimming
+ - setting NURBS properties (-> sampling etc.)
Differences from C++ source
- - no pooling
- - pointers to arrays are replaced by CArrayOf... classes and their methods
+ - no pooling
+ - pointers to arrays are replaced by CArrayOf... classes and their methods
Unimplemented or incomplete "calltree top" methods (according to glu.def in Mesa 6.5)
- gluBeginTrim
- gluDeleteNurbsRenderer - won't be needed
- gluEndTrim
- gluGetNurbsProperty
- gluLoadSamplingMatrices
- gluNurbsCallback
- gluNurbsCallbackData
- gluNurbsCallbackDataEXT
- gluNurbsCurve - TODO type switch
- gluNurbsProperty
- gluPwlCurve
- gluQuadricCallback - not a NURBS method
+ gluBeginTrim
+ gluDeleteNurbsRenderer - won't be needed
+ gluEndTrim
+ gluGetNurbsProperty
+ gluLoadSamplingMatrices
+ gluNurbsCallback
+ gluNurbsCallbackData
+ gluNurbsCallbackDataEXT
+ gluNurbsCurve - TODO type switch
+ gluNurbsProperty
+ gluPwlCurve
+ gluQuadricCallback - not a NURBS method
As of files
- - Arc[ST]dirSorter.java - unimplemented (part of tesselation)
- - Backend.java:194 - wireframe quads - part of tesselation/callback
- - Curve.java:141-204 - culling
- - DisplayList.java:57 - append to DL - not sure whether it will be needed
- - GLUnurbs.java :443,484 - error values
- :445 - trimming
- :512 - error handling (callback)
- :530 - loadGLmatrices
- :786 - nuid - nurbs object id - won't be needed I think
- :803 - end trim
- - GLUwNURBS.java:68,176 - NUBRS properties
- - Knotspec.java :371 - copying in general case (more than 4 coords)
- :517 - copying with more than 4 coords
- :556 - pt_oo_sum default
- - Knotvector.java:165 - show method (probably debugging)
- - Mapdesc.java :354 - get property
- :435 - xFormMat - change param cp to CArrayOfFloats; probably sampling functionality
- - Maplist.java:68 - clear ?
- - OpenGLCurveEvaluator.java :132 - tess./callback code
- :168 - mapgrid1f
- :190 - tess./callback code (output triangles)
- - OpenGLSurfaceEvaluator.java :77 . tess./callback code
- :81 - glGetIntegerValue
- :114 - tess./callback code
- :117 - Level of detail
- :144,161,201 - tess./callback code - output triangles
- - Patch.java:55 - constructor stuff ?
- - Patchlist.java:55 - constructor stuff ?
- :97 - cull check
- :105 - step size
- :115 - need of sampling subdivision
- :126 - need of subdivision
- :137 - need of non sampling subd.
- :146 - bbox (??)
- -Quilt.java :254 - culling
- :282 - rates
- -Subdivider.java - all TODOs - it's stuff about trimming probably
- :545 - jumpbuffer - not sure purpose it exactly served in original source
+ - Arc[ST]dirSorter.java - unimplemented (part of tesselation)
+ - Backend.java:194 - wireframe quads - part of tesselation/callback
+ - Curve.java:141-204 - culling
+ - DisplayList.java:57 - append to DL - not sure whether it will be needed
+ - GLUnurbs.java :443,484 - error values
+ :445 - trimming
+ :512 - error handling (callback)
+ :530 - loadGLmatrices
+ :786 - nuid - nurbs object id - won't be needed I think
+ :803 - end trim
+ - GLUwNURBS.java:68,176 - NUBRS properties
+ - Knotspec.java :371 - copying in general case (more than 4 coords)
+ :517 - copying with more than 4 coords
+ :556 - pt_oo_sum default
+ - Knotvector.java:165 - show method (probably debugging)
+ - Mapdesc.java :354 - get property
+ :435 - xFormMat - change param cp to CArrayOfFloats; probably sampling functionality
+ - Maplist.java:68 - clear ?
+ - OpenGLCurveEvaluator.java :132 - tess./callback code
+ :168 - mapgrid1f
+ :190 - tess./callback code (output triangles)
+ - OpenGLSurfaceEvaluator.java :77 . tess./callback code
+ :81 - glGetIntegerValue
+ :114 - tess./callback code
+ :117 - Level of detail
+ :144,161,201 - tess./callback code - output triangles
+ - Patch.java:55 - constructor stuff ?
+ - Patchlist.java:55 - constructor stuff ?
+ :97 - cull check
+ :105 - step size
+ :115 - need of sampling subdivision
+ :126 - need of subdivision
+ :137 - need of non sampling subd.
+ :146 - bbox (??)
+ -Quilt.java :254 - culling
+ :282 - rates
+ -Subdivider.java - all TODOs - it's stuff about trimming probably
+ :545 - jumpbuffer - not sure purpose it exactly served in original source
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
index 3378dba8d..37774f811 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
@@ -187,7 +187,7 @@ public class Subdivider {
renderhints.init();
if (qlist == null) {
- // System.out.println("qlist is null");
+ // System.out.println("qlist is null");
return;
}
@@ -217,7 +217,7 @@ public class Subdivider {
} else {
float[] rate = new float[2];
qlist.findRates(spbrkpts, tpbrkpts, rate);
- // System.out.println("subdivider.drawsurfaces decompose");
+ // System.out.println("subdivider.drawsurfaces decompose");
}
backend.bgnsurf(renderhints.wiretris, renderhints.wirequads);
@@ -268,7 +268,7 @@ public class Subdivider {
*/
private void freejarcs(Bin initialbin2) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.freejarcs");
+ // System.out.println("TODO subdivider.freejarcs");
}
/**
@@ -319,7 +319,7 @@ public class Subdivider {
}
}
} else{
- // System.out.println("Source is empty - subdivider.splitins");
+ // System.out.println("Source is empty - subdivider.splitins");
}
}
@@ -331,7 +331,7 @@ public class Subdivider {
*/
private void splitInT(Bin source, int start, int end) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.splitint");
+ // System.out.println("TODO subdivider.splitint");
if (source.isnonempty()) {
if (start != end) {
@@ -485,7 +485,7 @@ public class Subdivider {
*/
private void monosplitInS(Bin source, int start, int end) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.monosplitins");
+ // System.out.println("TODO subdivider.monosplitins");
}
/**
@@ -494,7 +494,7 @@ public class Subdivider {
*/
private void findIrregularS(Bin source) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.findIrregularS");
+ // System.out.println("TODO subdivider.findIrregularS");
}
/**
@@ -502,7 +502,7 @@ public class Subdivider {
*/
private void setArcTypePwl() {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.setarctypepwl");
+ // System.out.println("TODO subdivider.setarctypepwl");
}
/**
@@ -512,7 +512,7 @@ public class Subdivider {
*/
private void tesselation(Bin source, Patchlist patchlist) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.tesselation");
+ // System.out.println("TODO subdivider.tesselation");
}
/**
@@ -520,7 +520,7 @@ public class Subdivider {
*/
private void setDegenerate() {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.setdegenerate");
+ // System.out.println("TODO subdivider.setdegenerate");
}
/**
@@ -611,7 +611,7 @@ public class Subdivider {
*/
private void join_t(Bin left, Bin right, Arc arc, Arc relative) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.join_t");
+ // System.out.println("TODO subdivider.join_t");
}
/**
@@ -621,7 +621,7 @@ public class Subdivider {
*/
private void check_t(Arc arc, Arc relative) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.check_t");
+ // System.out.println("TODO subdivider.check_t");
}
/**
@@ -670,7 +670,7 @@ public class Subdivider {
*/
private void link(Arc jarc1, Arc jarc2, Arc newright, Arc newleft) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.link");
+ // System.out.println("TODO subdivider.link");
}
/**
@@ -679,7 +679,7 @@ public class Subdivider {
*/
private boolean isBezierArcType() {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.isbezierarc");
+ // System.out.println("TODO subdivider.isbezierarc");
return true;
}
@@ -690,7 +690,7 @@ public class Subdivider {
*/
private void simplelink(Arc jarc1, Arc jarc2) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.simplelink");
+ // System.out.println("TODO subdivider.simplelink");
}
/**
@@ -700,7 +700,7 @@ public class Subdivider {
*/
private void check_s(Arc arc, Arc relative) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.check_s");
+ // System.out.println("TODO subdivider.check_s");
}
@@ -756,7 +756,7 @@ public class Subdivider {
} else {
if (hdiff > 0) {
// TODO rest
- // System.out.println("TODO subdivider.partition rest of else");
+ // System.out.println("TODO subdivider.partition rest of else");
} else if (hdiff == 0) {
tailonleft.addarc(jarc);
} else {
@@ -788,7 +788,7 @@ public class Subdivider {
private void classify_tailonright_t(Bin tailonright, Bin intersections,
Bin right, float value) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.classify_tailonright_t");
+ // System.out.println("TODO subdivider.classify_tailonright_t");
}
@@ -862,7 +862,7 @@ public class Subdivider {
*/
private boolean ccwTurn_sr(Arc prev, Arc j) {
// TODO Auto-generated method stub
- // System.out.println("TODO ccwTurn_sr");
+ // System.out.println("TODO ccwTurn_sr");
return false;
}
@@ -876,7 +876,7 @@ public class Subdivider {
private void classify_headonright_t(Bin headonright, Bin intersections,
Bin right, float value) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.classify_headonright_t");
+ // System.out.println("TODO subdivider.classify_headonright_t");
}
/**
@@ -889,7 +889,7 @@ public class Subdivider {
private void classify_tailonleft_t(Bin tailonleft, Bin intersections,
Bin left, float value) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.classify_tailonleft_t");
+ // System.out.println("TODO subdivider.classify_tailonleft_t");
}
/**
@@ -930,7 +930,7 @@ public class Subdivider {
*/
private boolean ccwTurn_tl(Arc prev, Arc j) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.ccwTurn_tl");
+ // System.out.println("TODO subdivider.ccwTurn_tl");
return false;
}
@@ -1004,7 +1004,7 @@ public class Subdivider {
*/
private boolean ccwTurn_sl(Arc prev, Arc j) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.ccwTurn_sl");
+ // System.out.println("TODO subdivider.ccwTurn_sl");
return false;
}
@@ -1018,7 +1018,7 @@ public class Subdivider {
*/
private int arc_split(Arc jarc, int param, float value, int i) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.arc_split");
+ // System.out.println("TODO subdivider.arc_split");
return 0;
}
@@ -1045,7 +1045,7 @@ public class Subdivider {
*/
private void outline(Bin source) {
// TODO Auto-generated method stub
- // System.out.println("TODO subdivider.outline");
+ // System.out.println("TODO subdivider.outline");
}
/**
@@ -1128,7 +1128,7 @@ public class Subdivider {
if (curvelist.needsSamplingSubdivision() && (subdivisions > 0)) {
// TODO kód
- // System.out.println("TODO subdivider-needsSamplingSubdivision");
+ // System.out.println("TODO subdivider-needsSamplingSubdivision");
} else {
int nu = (int) (1 + curvelist.range[2] / curvelist.stepsize);
backend.curvgrid(curvelist.range[0], curvelist.range[1], nu);
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/ActiveRegion.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/ActiveRegion.java
index 13c226a7c..17f58309a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/ActiveRegion.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/ActiveRegion.java
@@ -54,16 +54,16 @@ package jogamp.opengl.glu.tessellator;
class ActiveRegion {
- GLUhalfEdge eUp; /* upper edge, directed right to left */
- DictNode nodeUp; /* dictionary node corresponding to eUp */
- int windingNumber; /* used to determine which regions are
+ GLUhalfEdge eUp; /* upper edge, directed right to left */
+ DictNode nodeUp; /* dictionary node corresponding to eUp */
+ int windingNumber; /* used to determine which regions are
* inside the polygon */
- boolean inside; /* is this region inside the polygon? */
- boolean sentinel; /* marks fake edges at t = +/-infinity */
- boolean dirty; /* marks regions where the upper or lower
+ boolean inside; /* is this region inside the polygon? */
+ boolean sentinel; /* marks fake edges at t = +/-infinity */
+ boolean dirty; /* marks regions where the upper or lower
* edge has changed, but we haven't checked
* whether they intersect yet */
- boolean fixUpperEdge; /* marks temporary edges introduced when
+ boolean fixUpperEdge; /* marks temporary edges introduced when
* we process a "right vertex" (one without
* any edges leaving to the right) */
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUface.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUface.java
index b15bf7195..892722d9f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUface.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUface.java
@@ -53,13 +53,13 @@
package jogamp.opengl.glu.tessellator;
class GLUface {
- public GLUface next; /* next face (never NULL) */
- public GLUface prev; /* previous face (never NULL) */
- public GLUhalfEdge anEdge; /* a half edge with this left face */
- public Object data; /* room for client's data */
+ public GLUface next; /* next face (never NULL) */
+ public GLUface prev; /* previous face (never NULL) */
+ public GLUhalfEdge anEdge; /* a half edge with this left face */
+ public Object data; /* room for client's data */
/* Internal data (keep hidden) */
- public GLUface trail; /* "stack" for conversion to strips */
- public boolean marked; /* flag for conversion to strips */
- public boolean inside; /* this face is in the polygon interior */
+ public GLUface trail; /* "stack" for conversion to strips */
+ public boolean marked; /* flag for conversion to strips */
+ public boolean inside; /* this face is in the polygon interior */
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
index 385a4384b..29944f9b2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
@@ -53,16 +53,16 @@
package jogamp.opengl.glu.tessellator;
class GLUhalfEdge {
- public GLUhalfEdge next; /* doubly-linked list (prev==Sym->next) */
- public GLUhalfEdge Sym; /* same edge, opposite direction */
- public GLUhalfEdge Onext; /* next edge CCW around origin */
- public GLUhalfEdge Lnext; /* next edge CCW around left face */
- public GLUvertex Org; /* origin vertex (Overtex too long) */
- public jogamp.opengl.glu.tessellator.GLUface Lface; /* left face */
+ public GLUhalfEdge next; /* doubly-linked list (prev==Sym->next) */
+ public GLUhalfEdge Sym; /* same edge, opposite direction */
+ public GLUhalfEdge Onext; /* next edge CCW around origin */
+ public GLUhalfEdge Lnext; /* next edge CCW around left face */
+ public GLUvertex Org; /* origin vertex (Overtex too long) */
+ public jogamp.opengl.glu.tessellator.GLUface Lface; /* left face */
/* Internal data (keep hidden) */
- public jogamp.opengl.glu.tessellator.ActiveRegion activeRegion; /* a region with this upper edge (sweep.c) */
- public int winding; /* change in winding number when crossing */
+ public jogamp.opengl.glu.tessellator.ActiveRegion activeRegion; /* a region with this upper edge (sweep.c) */
+ public int winding; /* change in winding number when crossing */
public boolean first;
public GLUhalfEdge(boolean first) {
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUmesh.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUmesh.java
index dfdf5be70..10af74319 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUmesh.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUmesh.java
@@ -53,8 +53,8 @@
package jogamp.opengl.glu.tessellator;
class GLUmesh {
- GLUvertex vHead = new GLUvertex(); /* dummy header for vertex list */
- jogamp.opengl.glu.tessellator.GLUface fHead = new GLUface(); /* dummy header for face list */
- jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = new GLUhalfEdge(true); /* dummy header for edge list */
- jogamp.opengl.glu.tessellator.GLUhalfEdge eHeadSym = new GLUhalfEdge(false); /* and its symmetric counterpart */
+ GLUvertex vHead = new GLUvertex(); /* dummy header for vertex list */
+ jogamp.opengl.glu.tessellator.GLUface fHead = new GLUface(); /* dummy header for face list */
+ jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = new GLUhalfEdge(true); /* dummy header for edge list */
+ jogamp.opengl.glu.tessellator.GLUhalfEdge eHeadSym = new GLUhalfEdge(false); /* and its symmetric counterpart */
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
index 182820bbc..d594cb3eb 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
@@ -59,32 +59,32 @@ import javax.media.opengl.glu.*;
public class GLUtessellatorImpl implements GLUtessellator {
public static final int TESS_MAX_CACHE = 100;
- private int state; /* what begin/end calls have we seen? */
+ private int state; /* what begin/end calls have we seen? */
- private GLUhalfEdge lastEdge; /* lastEdge->Org is the most recent vertex */
- GLUmesh mesh; /* stores the input contours, and eventually
+ private GLUhalfEdge lastEdge; /* lastEdge->Org is the most recent vertex */
+ GLUmesh mesh; /* stores the input contours, and eventually
the tessellation itself */
/*** state needed for projecting onto the sweep plane ***/
- double[] normal = new double[3]; /* user-specified normal (if provided) */
- double[] sUnit = new double[3]; /* unit vector in s-direction (debugging) */
- double[] tUnit = new double[3]; /* unit vector in t-direction (debugging) */
+ double[] normal = new double[3]; /* user-specified normal (if provided) */
+ double[] sUnit = new double[3]; /* unit vector in s-direction (debugging) */
+ double[] tUnit = new double[3]; /* unit vector in t-direction (debugging) */
/*** state needed for the line sweep ***/
- private double relTolerance; /* tolerance for merging features */
- int windingRule; /* rule for determining polygon interior */
- boolean fatalError; /* fatal error: needed combine callback */
+ private double relTolerance; /* tolerance for merging features */
+ int windingRule; /* rule for determining polygon interior */
+ boolean fatalError; /* fatal error: needed combine callback */
- Dict dict; /* edge dictionary for sweep line */
- PriorityQ pq; /* priority queue of vertex events */
- GLUvertex event; /* current sweep event being processed */
+ Dict dict; /* edge dictionary for sweep line */
+ PriorityQ pq; /* priority queue of vertex events */
+ GLUvertex event; /* current sweep event being processed */
/*** state needed for rendering callbacks (see render.c) ***/
- boolean flagBoundary; /* mark boundary edges (use EdgeFlag) */
- boolean boundaryOnly; /* Extract contours, not triangles */
+ boolean flagBoundary; /* mark boundary edges (use EdgeFlag) */
+ boolean boundaryOnly; /* Extract contours, not triangles */
boolean avoidDegenerateTris; /* JOGL-specific hint to try to improve triangulation
by avoiding producing degenerate (zero-area) triangles;
has not been tested exhaustively and is therefore an option */
@@ -96,12 +96,12 @@ public class GLUtessellatorImpl implements GLUtessellator {
/*** state needed to cache single-contour polygons for renderCache() */
- private boolean flushCacheOnNextVertex; /* empty cache on next vertex() call */
- int cacheCount; /* number of cached vertices */
- CachedVertex[] cache = new CachedVertex[TESS_MAX_CACHE]; /* the vertex data */
+ private boolean flushCacheOnNextVertex; /* empty cache on next vertex() call */
+ int cacheCount; /* number of cached vertices */
+ CachedVertex[] cache = new CachedVertex[TESS_MAX_CACHE]; /* the vertex data */
/*** rendering callbacks that also pass polygon data ***/
- private Object polygonData; /* client data for current polygon */
+ private Object polygonData; /* client data for current polygon */
private GLUtessellatorCallback callBegin;
private GLUtessellatorCallback callEdgeFlag;
@@ -120,10 +120,10 @@ public class GLUtessellatorImpl implements GLUtessellator {
private GLUtessellatorCallback callCombineData;
private static final double GLU_TESS_DEFAULT_TOLERANCE = 0.0;
-// private static final int GLU_TESS_MESH = 100112; /* void (*)(GLUmesh *mesh) */
+// private static final int GLU_TESS_MESH = 100112; /* void (*)(GLUmesh *mesh) */
private static GLUtessellatorCallback NULL_CB = new GLUtessellatorCallbackAdapter();
-// #define MAX_FAST_ALLOC (MAX(sizeof(EdgePair), \
+// #define MAX_FAST_ALLOC (MAX(sizeof(EdgePair), \
// MAX(sizeof(GLUvertex),sizeof(GLUface))))
private GLUtessellatorImpl() {
@@ -220,7 +220,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
case GLU.GLU_TESS_WINDING_RULE:
int windingRule = (int) value;
- if (windingRule != value) break; /* not an integer */
+ if (windingRule != value) break; /* not an integer */
switch (windingRule) {
case GLU.GLU_TESS_WINDING_ODD:
@@ -523,7 +523,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
* Each interior region is guaranteed be monotone.
*/
if (!Sweep.__gl_computeInterior(this)) {
- throw new RuntimeException(); /* could've used a label */
+ throw new RuntimeException(); /* could've used a label */
}
mesh = this.mesh;
@@ -539,7 +539,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
} else {
rc = TessMono.__gl_meshTessellateInterior(mesh, avoidDegenerateTris);
}
- if (!rc) throw new RuntimeException(); /* could've used a label */
+ if (!rc) throw new RuntimeException(); /* could've used a label */
Mesh.__gl_meshCheckMesh(mesh);
@@ -552,7 +552,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
if (boundaryOnly) {
Render.__gl_renderBoundary(this, mesh); /* output boundary contours */
} else {
- Render.__gl_renderMesh(this, mesh); /* output strips and fans */
+ Render.__gl_renderMesh(this, mesh); /* output strips and fans */
}
}
// if (callMesh != NULL_CB) {
@@ -564,7 +564,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
// * faces in the first place.
// */
// TessMono.__gl_meshDiscardExterior(mesh);
-// callMesh.mesh(mesh); /* user wants the mesh itself */
+// callMesh.mesh(mesh); /* user wants the mesh itself */
// mesh = null;
// polygonData = null;
// return;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUvertex.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUvertex.java
index c30d75946..ecc91c2b6 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUvertex.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUvertex.java
@@ -53,13 +53,13 @@
package jogamp.opengl.glu.tessellator;
class GLUvertex {
- public GLUvertex next; /* next vertex (never NULL) */
- public GLUvertex prev; /* previous vertex (never NULL) */
- public jogamp.opengl.glu.tessellator.GLUhalfEdge anEdge; /* a half-edge with this origin */
- public Object data; /* client's data */
+ public GLUvertex next; /* next vertex (never NULL) */
+ public GLUvertex prev; /* previous vertex (never NULL) */
+ public jogamp.opengl.glu.tessellator.GLUhalfEdge anEdge; /* a half-edge with this origin */
+ public Object data; /* client's data */
/* Internal data (keep hidden) */
- public double[] coords = new double[3]; /* vertex location in 3D */
- public double s, t; /* projection onto the sweep plane */
- public int pqHandle; /* to allow deletion from priority queue */
+ public double[] coords = new double[3]; /* vertex location in 3D */
+ public double s, t; /* projection onto the sweep plane */
+ public int pqHandle; /* to allow deletion from priority queue */
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
index 942dfe8d1..eb48aa5a4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
@@ -281,8 +281,8 @@ class Mesh {
/* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the
* mesh connectivity and topology. It changes the mesh so that
- * eOrg->Onext <- OLD( eDst->Onext )
- * eDst->Onext <- OLD( eOrg->Onext )
+ * eOrg->Onext <- OLD( eDst->Onext )
+ * eDst->Onext <- OLD( eOrg->Onext )
* where OLD(...) means the value before the meshSplice operation.
*
* This can have two effects on the vertex structure:
@@ -453,9 +453,9 @@ class Mesh {
/* Set the vertex and face information */
eOrg.Sym.Org = eNew.Org;
- eNew.Sym.Org.anEdge = eNew.Sym; /* may have pointed to eOrg.Sym */
+ eNew.Sym.Org.anEdge = eNew.Sym; /* may have pointed to eOrg.Sym */
eNew.Sym.Lface = eOrg.Sym.Lface;
- eNew.winding = eOrg.winding; /* copy old winding information */
+ eNew.winding = eOrg.winding; /* copy old winding information */
eNew.Sym.winding = eOrg.Sym.winding;
return eNew;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
index 7d5acd9f8..196e6cf27 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
@@ -60,7 +60,7 @@ class Normal {
}
static boolean SLANTED_SWEEP = false;
- static double S_UNIT_X; /* Pre-normalized */
+ static double S_UNIT_X; /* Pre-normalized */
static double S_UNIT_Y;
private static final boolean TRUE_PROJECT = false;
@@ -75,7 +75,7 @@ class Normal {
* direction to be something unusual (ie. not parallel to one of the
* coordinate axes).
*/
- S_UNIT_X = 0.50941539564955385; /* Pre-normalized */
+ S_UNIT_X = 0.50941539564955385; /* Pre-normalized */
S_UNIT_Y = 0.86052074622010633;
} else {
S_UNIT_X = 1.0;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
index 899df2e3d..474056cc3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
@@ -76,7 +76,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
freeList = 0;
this.leq = leq;
- nodes[1].handle = 1; /* so that Minimum() returns NULL */
+ nodes[1].handle = 1; /* so that Minimum() returns NULL */
handles[1].key = null;
}
@@ -171,7 +171,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
nodes = pqNodes;
if (nodes == null) {
- nodes = saveNodes; /* restore ptr to free upon return */
+ nodes = saveNodes; /* restore ptr to free upon return */
return Integer.MAX_VALUE;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
index f37f98ace..f9e0225e3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
@@ -152,7 +152,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
} while (LT(leq, keys[order[j]], keys[piv]));
Swap(order, i, j);
} while (i < j);
- Swap(order, i, j); /* Undo last swap */
+ Swap(order, i, j); /* Undo last swap */
if (i - p < r - j) {
stack[top].p = j + 1;
stack[top].r = r;
@@ -176,7 +176,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
}
max = size;
initialized = true;
- heap.pqInit(); /* always succeeds */
+ heap.pqInit(); /* always succeeds */
/* #ifndef NDEBUG
p = order;
@@ -208,7 +208,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
System.arraycopy( keys, 0, pqKeys, 0, keys.length );
keys = pqKeys;
if (keys == null) {
- keys = saveKey; /* restore ptr to free upon return */
+ keys = saveKey; /* restore ptr to free upon return */
return Integer.MAX_VALUE;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
index 34b7ee55b..1801e1c59 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
@@ -79,8 +79,8 @@ class Render {
this.render = render;
}
- long size; /* number of triangles used */
- jogamp.opengl.glu.tessellator.GLUhalfEdge eStart; /* edge where this primitive starts */
+ long size; /* number of triangles used */
+ jogamp.opengl.glu.tessellator.GLUhalfEdge eStart; /* edge where this primitive starts */
renderCallBack render;
};
@@ -295,7 +295,7 @@ class Render {
*/
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
int newState;
- int edgeState = -1; /* force edge state output for first vertex */
+ int edgeState = -1; /* force edge state output for first vertex */
tess.callBeginOrBeginData(GL.GL_TRIANGLES);
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
index 95eb5dda1..b4a400c1c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
@@ -300,7 +300,7 @@ class Sweep {
regPrev = regFirst;
ePrev = regFirst.eUp;
while (regPrev != regLast) {
- regPrev.fixUpperEdge = false; /* placement was OK */
+ regPrev.fixUpperEdge = false; /* placement was OK */
reg = RegionBelow(regPrev);
e = reg.eUp;
if (e.Org != ePrev.Org) {
@@ -327,7 +327,7 @@ class Sweep {
if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
if (!Mesh.__gl_meshSplice(ePrev, e)) throw new RuntimeException();
}
- FinishRegion(tess, regPrev); /* may change reg.eUp */
+ FinishRegion(tess, regPrev); /* may change reg.eUp */
ePrev = reg.eUp;
regPrev = reg;
}
@@ -627,11 +627,11 @@ class Sweep {
assert (orgUp != tess.event && orgLo != tess.event);
assert (!regUp.fixUpperEdge && !regLo.fixUpperEdge);
- if (orgUp == orgLo) return false; /* right endpoints are the same */
+ if (orgUp == orgLo) return false; /* right endpoints are the same */
tMinUp = Math.min(orgUp.t, dstUp.t);
tMaxLo = Math.max(orgLo.t, dstLo.t);
- if (tMinUp > tMaxLo) return false; /* t ranges do not overlap */
+ if (tMinUp > tMaxLo) return false; /* t ranges do not overlap */
if (Geom.VertLeq(orgUp, orgLo)) {
if (Geom.EdgeSign(dstLo, orgUp, orgLo) > 0) return false;
@@ -743,7 +743,7 @@ class Sweep {
eUp.Org.t = isect.t;
eUp.Org.pqHandle = tess.pq.pqInsert(eUp.Org); /* __gl_pqSortInsert */
if (eUp.Org.pqHandle == Long.MAX_VALUE) {
- tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
+ tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
tess.pq = null;
throw new RuntimeException();
}
@@ -959,7 +959,7 @@ class Sweep {
regUp.fixUpperEdge = false;
}
if (!Mesh.__gl_meshSplice(vEvent.anEdge, e)) throw new RuntimeException();
- SweepEvent(tess, vEvent); /* recurse */
+ SweepEvent(tess, vEvent); /* recurse */
return;
}
@@ -1001,9 +1001,9 @@ class Sweep {
*
* - the degenerate case: if vEvent is close enough to U or L, we
* merge vEvent into that edge chain. The subcases are:
- * - merging with the rightmost vertex of U or L
- * - merging with the active edge of U or L
- * - merging with an already-processed portion of U or L
+ * - merging with the rightmost vertex of U or L
+ * - merging with the active edge of U or L
+ * - merging with an already-processed portion of U or L
*/ {
ActiveRegion regUp, regLo, reg;
GLUhalfEdge eUp, eLo, eNew;
@@ -1063,7 +1063,7 @@ class Sweep {
ActiveRegion regUp, reg;
GLUhalfEdge e, eTopLeft, eBottomLeft;
- tess.event = vEvent; /* for access in EdgeLeq() */
+ tess.event = vEvent; /* for access in EdgeLeq() */
DebugEvent(tess);
/* Check if this vertex is the right endpoint of an edge that is
@@ -1130,7 +1130,7 @@ class Sweep {
e.Org.t = t;
e.Sym.Org.s = -SENTINEL_COORD;
e.Sym.Org.t = t;
- tess.event = e.Sym.Org; /* initialize it */
+ tess.event = e.Sym.Org; /* initialize it */
reg.eUp = e;
reg.windingNumber = 0;
@@ -1180,7 +1180,7 @@ class Sweep {
DeleteRegion(tess, reg);
/* __gl_meshDelete( reg.eUp );*/
}
- Dict.dictDeleteDict(tess.dict); /* __gl_dictListDeleteDict */
+ Dict.dictDeleteDict(tess.dict); /* __gl_dictListDeleteDict */
}
@@ -1199,7 +1199,7 @@ class Sweep {
if (Geom.VertEq(e.Org, e.Sym.Org) && e.Lnext.Lnext != e) {
/* Zero-length edge, contour has at least 3 edges */
- SpliceMergeVertices(tess, eLnext, e); /* deletes e.Org */
+ SpliceMergeVertices(tess, eLnext, e); /* deletes e.Org */
if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException(); /* e is a self-loop */
e = eLnext;
eLnext = e.Lnext;
@@ -1243,7 +1243,7 @@ class Sweep {
if (v.pqHandle == Long.MAX_VALUE) break;
}
if (v != vHead || !pq.pqInit()) { /* __gl_pqSortInit */
- tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
+ tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
tess.pq = null;
return false;
}
@@ -1306,7 +1306,7 @@ class Sweep {
* all the vertices in a priority queue. Events are processed in
* lexicographic order, ie.
*
- * e1 < e2 iff e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y)
+ * e1 < e2 iff e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y)
*/
RemoveDegenerateEdges(tess);
if (!InitPriorityQ(tess)) return false; /* if error */
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 085889739..db737902a 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -49,7 +49,7 @@ import com.jogamp.gluegen.runtime.ProcAddressTable;
import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
public abstract class MacOSXCGLContext extends GLContextImpl
-{
+{
protected boolean isNSContext;
private CGLExt cglExt;
// Table that holds the addresses of the native C-language entry points for
@@ -82,9 +82,9 @@ public abstract class MacOSXCGLContext extends GLContextImpl
return cglExtProcAddressTable;
}
- protected Map/*<String, String>*/ getFunctionNameMap() { return null; }
+ protected Map<String, String> getFunctionNameMap() { return null; }
- protected Map/*<String, String>*/ getExtensionNameMap() { return null; }
+ protected Map<String, String> getExtensionNameMap() { return null; }
protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
return 0; // FIXME
@@ -178,7 +178,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl
}
}
}
-
+
protected void releaseImpl() throws GLException {
if ( isNSContext ) {
if (!CGL.clearCurrentContext(contextHandle)) {
@@ -188,7 +188,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl
CGL.CGLReleaseContext(contextHandle);
}
}
-
+
protected void destroyImpl() throws GLException {
if ( !isNSContext ) {
if (CGL.kCGLNoError != CGL.CGLDestroyContext(contextHandle)) {
@@ -230,12 +230,12 @@ public abstract class MacOSXCGLContext extends GLContextImpl
if (DEBUG) {
System.err.println(getThreadName() + ": !!! Initializing CGL extension address table: "+key);
}
- CGLExtProcAddressTable table = null;
+ ProcAddressTable table = null;
synchronized(mappedContextTypeObjectLock) {
- table = (CGLExtProcAddressTable) mappedGLXProcAddress.get( key );
+ table = mappedGLXProcAddress.get( key );
}
if(null != table) {
- cglExtProcAddressTable = table;
+ cglExtProcAddressTable = (CGLExtProcAddressTable) table;
if(DEBUG) {
System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable reusing key("+key+") -> "+table.hashCode());
}
@@ -254,12 +254,12 @@ public abstract class MacOSXCGLContext extends GLContextImpl
}
}
}
-
+
public String getPlatformExtensionsString()
{
return "";
}
-
+
protected void swapBuffers() {
DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLContext.java
index 6dba11038..949963fa0 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLContext.java
@@ -48,7 +48,7 @@ public class MacOSXOffscreenCGLContext extends MacOSXPbufferCGLContext
GLContext shareWith) {
super(drawable, shareWith);
}
-
+
public int getOffscreenContextPixelDataType() {
GL gl = getGL();
return gl.isGL2GL3()?GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1;
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java
index 6eda3f068..dc5ce26c8 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java
@@ -138,7 +138,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
if (capabilities.getPbufferFloatingPointBuffers() &&
- !isTigerOrLater) {
+ !isTigerOrLater) {
throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
}
// Change our OpenGL mode to match that of any share context before we create ourselves
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
index 4e5afc683..854d01fa6 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
@@ -214,15 +214,15 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
- glVertexPointer(GLArrayDataWrapper.createFixed(gl, GL_VERTEX_ARRAY, size, type, false, stride, pointer, 0, 0));
+ glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, false, stride, pointer, -1, -1, -1));
}
public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
- glVertexPointer(GLArrayDataWrapper.createFixed(gl, GL_VERTEX_ARRAY, size, type, false,
- stride, null, vboName, pointer_buffer_offset));
+ glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, false, stride,
+ null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW));
}
public void glColorPointer(GLArrayData array) {
@@ -241,16 +241,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glColorPointer(gl, array);
}
public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
- glColorPointer(GLArrayDataWrapper.createFixed(gl, GL_COLOR_ARRAY, size, type, false,
- stride, pointer, 0, 0));
+ glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, false, stride,
+ pointer, -1, -1, -1));
}
public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
- glColorPointer(GLArrayDataWrapper.createFixed(gl, GL_COLOR_ARRAY, size, type, false,
- stride, null, vboName, pointer_buffer_offset));
+ glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, false, stride,
+ null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW));
}
public void glNormalPointer(GLArrayData array) {
@@ -272,16 +272,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glNormalPointer(gl, array);
}
public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
- glNormalPointer(GLArrayDataWrapper.createFixed(gl, GL_NORMAL_ARRAY, 3, type, false,
- stride, pointer, 0, 0));
+ glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, false, stride,
+ pointer, -1, -1, -1));
}
public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
- glNormalPointer(GLArrayDataWrapper.createFixed(gl, GL_NORMAL_ARRAY, 3, type, false,
- stride, null, vboName, pointer_buffer_offset));
+ glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, false, stride,
+ null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW));
}
public void glTexCoordPointer(GLArrayData array) {
@@ -301,7 +301,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
glTexCoordPointer(
- GLArrayDataWrapper.createFixed(gl, GL_TEXTURE_COORD_ARRAY, size, type, false, stride, pointer, 0,0));
+ GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, false, stride, pointer, -1, -1, -1));
}
public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
@@ -309,8 +309,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
glTexCoordPointer(
- GLArrayDataWrapper.createFixed(gl, GL_TEXTURE_COORD_ARRAY, size, type, false,
- stride, null, vboName, pointer_buffer_offset) );
+ GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, false, stride,
+ null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW) );
}
public final String toString() {
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
index b77cf4617..fadce2b4d 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -83,9 +83,9 @@ public class FixedFuncPipeline {
}
public void glEnableClientState(GL2ES2 gl, int glArrayIndex) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
- shaderState.glEnableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
+ shaderState.enableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
// textureCoordsEnabled |= (1 << activeTextureUnit);
if ( textureCoordsEnabled.get(activeTextureUnit) != 1 ) {
textureCoordsEnabled.put(activeTextureUnit, 1);
@@ -94,9 +94,9 @@ public class FixedFuncPipeline {
}
public void glDisableClientState(GL2ES2 gl, int glArrayIndex) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
- shaderState.glDisableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
+ shaderState.disableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
// textureCoordsEnabled &= ~(1 << activeTextureUnit);
if ( textureCoordsEnabled.get(activeTextureUnit) != 0 ) {
textureCoordsEnabled.put(activeTextureUnit, 0);
@@ -105,37 +105,37 @@ public class FixedFuncPipeline {
}
public void glVertexPointer(GL2ES2 gl, GLArrayData data) {
- shaderState.glUseProgram(gl, true);
- shaderState.glVertexAttribPointer(gl, data);
+ shaderState.useProgram(gl, true);
+ shaderState.vertexAttribPointer(gl, data);
}
public void glColorPointer(GL2ES2 gl, GLArrayData data) {
- shaderState.glUseProgram(gl, true);
- shaderState.glVertexAttribPointer(gl, data);
+ shaderState.useProgram(gl, true);
+ shaderState.vertexAttribPointer(gl, data);
}
public void glColor4fv(GL2ES2 gl, FloatBuffer data ) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
GLUniformData ud = shaderState.getUniform(mgl_ColorStatic);
if(null!=ud) {
ud.setData(data);
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
}
public void glNormalPointer(GL2ES2 gl, GLArrayData data) {
- shaderState.glUseProgram(gl, true);
- shaderState.glVertexAttribPointer(gl, data);
+ shaderState.useProgram(gl, true);
+ shaderState.vertexAttribPointer(gl, data);
}
public void glTexCoordPointer(GL2ES2 gl, GLArrayData data) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
data.setName( getArrayIndexName(data.getIndex()) );
- shaderState.glVertexAttribPointer(gl, data);
+ shaderState.vertexAttribPointer(gl, data);
}
public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
light -=GLLightingFunc.GL_LIGHT0;
if(0 <= light && light < MAX_LIGHTS) {
GLUniformData ud = null;
@@ -178,7 +178,7 @@ public class FixedFuncPipeline {
}
if(null!=ud) {
ud.setData(params);
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
} else if(verbose) {
System.err.println("glLightfv light not within [0.."+MAX_LIGHTS+"]: "+light);
@@ -186,7 +186,7 @@ public class FixedFuncPipeline {
}
public void glMaterialfv(GL2ES2 gl, int face, int pname, java.nio.FloatBuffer params) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
switch (face) {
case GL.GL_FRONT:
@@ -228,33 +228,33 @@ public class FixedFuncPipeline {
}
if(null!=ud) {
ud.setData(params);
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
}
public void glShadeModel(GL2ES2 gl, int mode) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
if(null!=ud) {
ud.setData(mode);
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
}
public void glActiveTexture(GL2ES2 gl, int textureUnit) {
textureUnit -= GL.GL_TEXTURE0;
if(0 <= textureUnit && textureUnit<MAX_TEXTURE_UNITS) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
GLUniformData ud;
ud = shaderState.getUniform(mgl_ActiveTexture);
if(null!=ud) {
ud.setData(textureUnit);
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
ud = shaderState.getUniform(mgl_ActiveTextureIdx);
if(null!=ud) {
ud.setData(textureUnit);
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
activeTextureUnit = textureUnit;
} else {
@@ -310,20 +310,20 @@ public class FixedFuncPipeline {
}
public void validate(GL2ES2 gl) {
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
GLUniformData ud;
if(pmvMatrix.update()) {
ud = shaderState.getUniform(mgl_PMVMatrix);
if(null!=ud) {
// same data object ..
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
} else {
- throw new GLException("Failed to update: mgl_PMVMatrix");
+ throw new GLException("Failed to update: gcu_PMVMatrix");
}
ud = shaderState.getUniform(mgl_NormalMatrix);
if(null!=ud) {
// same data object ..
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
}
ud = shaderState.getUniform(mgl_ColorEnabled);
@@ -331,14 +331,14 @@ public class FixedFuncPipeline {
int ca = (shaderState.isVertexAttribArrayEnabled(mgl_Color)==true)?1:0;
if(ca!=ud.intValue()) {
ud.setData(ca);
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
}
ud = shaderState.getUniform(mgl_CullFace);
if(null!=ud) {
if(cullFace!=ud.intValue()) {
ud.setData(cullFace);
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
}
@@ -346,7 +346,7 @@ public class FixedFuncPipeline {
ud = shaderState.getUniform(mgl_LightsEnabled);
if(null!=ud) {
// same data object
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
lightsEnabledDirty=false;
}
@@ -355,7 +355,7 @@ public class FixedFuncPipeline {
ud = shaderState.getUniform(mgl_TexCoordEnabled);
if(null!=ud) {
// same data object
- shaderState.glUniform(gl, ud);
+ shaderState.uniform(gl, ud);
}
textureCoordsEnabledDirty=false;
}
@@ -447,43 +447,43 @@ public class FixedFuncPipeline {
}
shaderState.attachShaderProgram(gl, shaderProgramColor);
- shaderState.glUseProgram(gl, true);
+ shaderState.useProgram(gl, true);
// mandatory ..
- if(!shaderState.glUniform(gl, new GLUniformData(mgl_PMVMatrix, 4, 4, pmvMatrix.glGetPMvMviMatrixf()))) {
+ if(!shaderState.uniform(gl, new GLUniformData(mgl_PMVMatrix, 4, 4, pmvMatrix.glGetPMvMviMatrixf()))) {
throw new GLException("Error setting PMVMatrix in shader: "+this);
}
// optional parameter ..
- shaderState.glUniform(gl, new GLUniformData(mgl_NormalMatrix, 3, 3, pmvMatrix.glGetNormalMatrixf()));
-
- shaderState.glUniform(gl, new GLUniformData(mgl_ColorEnabled, 0));
- shaderState.glUniform(gl, new GLUniformData(mgl_ColorStatic, 4, zero4f));
- shaderState.glUniform(gl, new GLUniformData(mgl_TexCoordEnabled, 1, textureCoordsEnabled));
- shaderState.glUniform(gl, new GLUniformData(mgl_ActiveTexture, activeTextureUnit));
- shaderState.glUniform(gl, new GLUniformData(mgl_ActiveTextureIdx, activeTextureUnit));
- shaderState.glUniform(gl, new GLUniformData(mgl_ShadeModel, 0));
- shaderState.glUniform(gl, new GLUniformData(mgl_CullFace, cullFace));
+ shaderState.uniform(gl, new GLUniformData(mgl_NormalMatrix, 3, 3, pmvMatrix.glGetNormalMatrixf()));
+
+ shaderState.uniform(gl, new GLUniformData(mgl_ColorEnabled, 0));
+ shaderState.uniform(gl, new GLUniformData(mgl_ColorStatic, 4, zero4f));
+ shaderState.uniform(gl, new GLUniformData(mgl_TexCoordEnabled, 1, textureCoordsEnabled));
+ shaderState.uniform(gl, new GLUniformData(mgl_ActiveTexture, activeTextureUnit));
+ shaderState.uniform(gl, new GLUniformData(mgl_ActiveTextureIdx, activeTextureUnit));
+ shaderState.uniform(gl, new GLUniformData(mgl_ShadeModel, 0));
+ shaderState.uniform(gl, new GLUniformData(mgl_CullFace, cullFace));
for(int i=0; i<MAX_LIGHTS; i++) {
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].ambient", 4, defAmbient));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].diffuse", 4, defDiffuse));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].specular", 4, defSpecular));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].position", 4, defPosition));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotDirection", 3, defSpotDir));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotExponent", defSpotExponent));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotCutoff", defSpotCutoff));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].constantAttenuation", defConstantAtten));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].linearAttenuation", defLinearAtten));
- shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].quadraticAttenuation", defQuadraticAtten));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].ambient", 4, defAmbient));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].diffuse", 4, defDiffuse));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].specular", 4, defSpecular));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].position", 4, defPosition));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotDirection", 3, defSpotDir));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotExponent", defSpotExponent));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotCutoff", defSpotCutoff));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].constantAttenuation", defConstantAtten));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].linearAttenuation", defLinearAtten));
+ shaderState.uniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].quadraticAttenuation", defQuadraticAtten));
}
- shaderState.glUniform(gl, new GLUniformData(mgl_LightsEnabled, 1, lightsEnabled));
- shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".ambient", 4, defMatAmbient));
- shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".diffuse", 4, defMatDiffuse));
- shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".specular", 4, defMatSpecular));
- shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".emission", 4, defMatEmission));
- shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".shininess", defMatShininess));
-
- shaderState.glUseProgram(gl, false);
+ shaderState.uniform(gl, new GLUniformData(mgl_LightsEnabled, 1, lightsEnabled));
+ shaderState.uniform(gl, new GLUniformData(mgl_FrontMaterial+".ambient", 4, defMatAmbient));
+ shaderState.uniform(gl, new GLUniformData(mgl_FrontMaterial+".diffuse", 4, defMatDiffuse));
+ shaderState.uniform(gl, new GLUniformData(mgl_FrontMaterial+".specular", 4, defMatSpecular));
+ shaderState.uniform(gl, new GLUniformData(mgl_FrontMaterial+".emission", 4, defMatEmission));
+ shaderState.uniform(gl, new GLUniformData(mgl_FrontMaterial+".shininess", defMatShininess));
+
+ shaderState.useProgram(gl, false);
}
protected static final boolean DEBUG=false;
@@ -508,7 +508,7 @@ public class FixedFuncPipeline {
protected ShaderProgram shaderProgramColorTextureLight;
// uniforms ..
- protected static final String mgl_PMVMatrix = "mgl_PMVMatrix"; // m4fv[3]
+ protected static final String mgl_PMVMatrix = "gcu_PMVMatrix"; // m4fv[3]
protected static final String mgl_NormalMatrix = "mgl_NormalMatrix"; // m4fv
protected static final String mgl_ColorEnabled = "mgl_ColorEnabled"; // 1i
protected static final String mgl_ColorStatic = "mgl_ColorStatic"; // 4fv
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
index 94017e79a..55e2e478c 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -58,8 +58,8 @@ import jogamp.opengl.GLContextShareSet;
import jogamp.opengl.GLDrawableImpl;
public class WindowsWGLContext extends GLContextImpl {
- static final Map/*<String, String>*/ functionNameMap;
- static final Map/*<String, String>*/ extensionNameMap;
+ static final Map<String, String> functionNameMap;
+ static final Map<String, String> extensionNameMap;
private boolean wglGetExtensionsStringEXTInitialized;
private boolean wglGetExtensionsStringEXTAvailable;
private boolean wglGLReadDrawableAvailableSet;
@@ -70,11 +70,11 @@ public class WindowsWGLContext extends GLContextImpl {
private WGLExtProcAddressTable wglExtProcAddressTable;
static {
- functionNameMap = new HashMap();
+ functionNameMap = new HashMap<String, String>();
functionNameMap.put("glAllocateMemoryNV", "wglAllocateMemoryNV");
functionNameMap.put("glFreeMemoryNV", "wglFreeMemoryNV");
- extensionNameMap = new HashMap();
+ extensionNameMap = new HashMap<String, String>();
extensionNameMap.put("GL_ARB_pbuffer", "WGL_ARB_pbuffer");
extensionNameMap.put("GL_ARB_pixel_format", "WGL_ARB_pixel_format");
}
@@ -161,9 +161,9 @@ public class WindowsWGLContext extends GLContextImpl {
return wglExtProcAddressTable;
}
- protected Map/*<String, String>*/ getFunctionNameMap() { return functionNameMap; }
+ protected Map<String, String> getFunctionNameMap() { return functionNameMap; }
- protected Map/*<String, String>*/ getExtensionNameMap() { return extensionNameMap; }
+ protected Map<String, String> getExtensionNameMap() { return extensionNameMap; }
protected void destroyContextARBImpl(long context) {
WGL.wglMakeCurrent(0, 0);
@@ -273,14 +273,11 @@ public class WindowsWGLContext extends GLContextImpl {
}
}
- int minor[] = new int[1];
- int major[] = new int[1];
- int ctp[] = new int[1];
boolean createContextARBTried = false;
// utilize the shared context's GLXExt in case it was using the ARB method and it already exists
if( null!=sharedContext && sharedContext.isCreatedWithARBMethod() ) {
- contextHandle = createContextARB(share, true, major, minor, ctp);
+ contextHandle = createContextARB(share, true);
createContextARBTried = true;
if (DEBUG && 0!=contextHandle) {
System.err.println(getThreadName() + ": createImpl: OK (ARB, using sharedContext) share "+share);
@@ -306,7 +303,7 @@ public class WindowsWGLContext extends GLContextImpl {
if(isCreateContextAttribsARBAvailable &&
isExtensionAvailable("WGL_ARB_create_context") ) {
// initial ARB context creation
- contextHandle = createContextARB(share, true, major, minor, ctp);
+ contextHandle = createContextARB(share, true);
createContextARBTried=true;
if (DEBUG) {
if(0!=contextHandle) {
@@ -334,10 +331,10 @@ public class WindowsWGLContext extends GLContextImpl {
if(glCaps.getGLProfile().isGL3()) {
WGL.wglMakeCurrent(0, 0);
WGL.wglDeleteContext(temp_ctx);
- throw new GLException("WindowsWGLContext.createContext failed, but context > GL2 requested "+getGLVersion(major[0], minor[0], ctp[0], "@creation")+", ");
+ throw new GLException("WindowsWGLContext.createContext failed, but context > GL2 requested "+getGLVersion()+", ");
}
if(DEBUG) {
- System.err.println("WindowsWGLContext.createContext failed, fall back to !ARB context "+getGLVersion(major[0], minor[0], ctp[0], "@creation"));
+ System.err.println("WindowsWGLContext.createContext failed, fall back to !ARB context "+getGLVersion());
}
// continue with temp context for GL < 3.0
@@ -405,12 +402,12 @@ public class WindowsWGLContext extends GLContextImpl {
wglGLReadDrawableAvailableSet=false;
wglGLReadDrawableAvailable=false;
- WGLExtProcAddressTable table = null;
+ ProcAddressTable table = null;
synchronized(mappedContextTypeObjectLock) {
- table = (WGLExtProcAddressTable) mappedGLXProcAddress.get( key );
+ table = mappedGLXProcAddress.get( key );
}
if(null != table) {
- wglExtProcAddressTable = table;
+ wglExtProcAddressTable = (WGLExtProcAddressTable) table;
if(DEBUG) {
System.err.println(getThreadName() + ": !!! GLContext WGL ProcAddressTable reusing key("+key+") -> "+table.hashCode());
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 248dfa482..c9cdcad90 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -169,7 +169,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
/**
* http://msdn.microsoft.com/en-us/library/ms724832%28v=vs.85%29.aspx
- * Windows XP 5.1
+ * Windows XP 5.1
*/
static final VersionNumber winXPVersionNumber = new VersionNumber ( 5, 1, 0);
@@ -199,22 +199,22 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
hasARBReadDrawable = arbReadDrawable;
vendor = glVendor;
if(null != vendor) {
- isVendorNVIDIA = vendor.startsWith("NVIDIA") ;
- isVendorATI = vendor.startsWith("ATI") ;
+ isVendorNVIDIA = vendor.startsWith("NVIDIA") ;
+ isVendorATI = vendor.startsWith("ATI") ;
}
- if ( isVendorATI() ) {
- final VersionNumber winVersion = new VersionNumber(Platform.getOSVersion(), ".");
- final boolean isWinXPOrLess = winVersion.compareTo(winXPVersionNumber) <= 0;
- if(DEBUG) {
- System.err.println("needsCurrenContext4ARBPFDQueries: "+winVersion+" <= "+winXPVersionNumber+" = "+isWinXPOrLess+" - "+Platform.getOSVersion());
- }
- needsCurrenContext4ARBPFDQueries = isWinXPOrLess;
- } else {
- if(DEBUG) {
- System.err.println("needsCurrenContext4ARBPFDQueries: false");
- }
- needsCurrenContext4ARBPFDQueries = false;
+ if ( isVendorATI() ) {
+ final VersionNumber winVersion = new VersionNumber(Platform.getOSVersion(), ".");
+ final boolean isWinXPOrLess = winVersion.compareTo(winXPVersionNumber) <= 0;
+ if(DEBUG) {
+ System.err.println("needsCurrenContext4ARBPFDQueries: "+winVersion+" <= "+winXPVersionNumber+" = "+isWinXPOrLess+" - "+Platform.getOSVersion());
+ }
+ needsCurrenContext4ARBPFDQueries = isWinXPOrLess;
+ } else {
+ if(DEBUG) {
+ System.err.println("needsCurrenContext4ARBPFDQueries: false");
+ }
+ needsCurrenContext4ARBPFDQueries = false;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index 1899f5212..8859d636a 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -158,7 +158,7 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
-
+
if (!GDI.SetPixelFormat(hdc, caps.getPFDID(), caps.getPFD())) {
throw new GLException("Unable to set pixel format " + caps +
" for device context " + toHexString(hdc) +
@@ -166,7 +166,7 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio
}
if (DEBUG) {
System.err.println("!!! setPixelFormat (ARB): hdc "+toHexString(hdc) +", "+caps);
- }
+ }
setCapsPFD(caps);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 8c1f5e87c..d765572a6 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -192,25 +192,25 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
if( !config.isExternal() ) {
- if( !config.isDetermined() ) {
- updateGraphicsConfiguration(config, chooser, factory, hdc, false, pfdIDs);
- } else {
- // set PFD if not set yet
- int pfdID = -1;
- boolean set = false;
- if ( 1 > ( pfdID = GDI.GetPixelFormat(hdc) ) ) {
- if (!GDI.SetPixelFormat(hdc, config.getPixelFormatID(), config.getPixelFormat())) {
- throw new GLException("Unable to set pixel format " + config.getPixelFormatID() +
- " for device context " + toHexString(hdc) +
- ": error code " + GDI.GetLastError());
- }
- set = true;
- }
- if (DEBUG) {
- System.err.println("!!! setPixelFormat (post): hdc "+toHexString(hdc) +", "+pfdID+" -> "+config.getPixelFormatID()+", set: "+set);
- Thread.dumpStack();
- }
- }
+ if( !config.isDetermined() ) {
+ updateGraphicsConfiguration(config, chooser, factory, hdc, false, pfdIDs);
+ } else {
+ // set PFD if not set yet
+ int pfdID = -1;
+ boolean set = false;
+ if ( 1 > ( pfdID = GDI.GetPixelFormat(hdc) ) ) {
+ if (!GDI.SetPixelFormat(hdc, config.getPixelFormatID(), config.getPixelFormat())) {
+ throw new GLException("Unable to set pixel format " + config.getPixelFormatID() +
+ " for device context " + toHexString(hdc) +
+ ": error code " + GDI.GetLastError());
+ }
+ set = true;
+ }
+ if (DEBUG) {
+ System.err.println("!!! setPixelFormat (post): hdc "+toHexString(hdc) +", "+pfdID+" -> "+config.getPixelFormatID()+", set: "+set);
+ Thread.dumpStack();
+ }
+ }
}
} finally {
ns.unlockSurface();
@@ -400,9 +400,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
if ( !extHDC && !pixelFormatSet ) {
- config.setPixelFormat(hdc, pixelFormatCaps);
+ config.setPixelFormat(hdc, pixelFormatCaps);
} else {
- config.setCapsPFD(pixelFormatCaps);
+ config.setCapsPFD(pixelFormatCaps);
}
return true;
}
@@ -476,9 +476,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
if ( !extHDC && !pixelFormatSet ) {
- config.setPixelFormat(hdc, pixelFormatCaps);
+ config.setPixelFormat(hdc, pixelFormatCaps);
} else {
- config.setCapsPFD(pixelFormatCaps);
+ config.setCapsPFD(pixelFormatCaps);
}
return true;
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
index 7d7614ca2..9f6a5cd1a 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -56,8 +56,8 @@ import jogamp.nativewindow.x11.X11Util;
public abstract class X11GLXContext extends GLContextImpl {
protected static final boolean TRACE_CONTEXT_CURRENT = false; // true;
- private static final Map/*<String, String>*/ functionNameMap;
- private static final Map/*<String, String>*/ extensionNameMap;
+ private static final Map<String, String> functionNameMap;
+ private static final Map<String, String> extensionNameMap;
private VersionNumber glXVersion;
private boolean glXVersionOneThreeCapable;
private boolean glXQueryExtensionsStringInitialized;
@@ -74,11 +74,11 @@ public abstract class X11GLXContext extends GLContextImpl {
protected boolean isDirect;
static {
- functionNameMap = new HashMap();
+ functionNameMap = new HashMap<String, String>();
functionNameMap.put("glAllocateMemoryNV", "glXAllocateMemoryNV");
functionNameMap.put("glFreeMemoryNV", "glXFreeMemoryNV");
- extensionNameMap = new HashMap();
+ extensionNameMap = new HashMap<String, String>();
extensionNameMap.put("GL_ARB_pbuffer", "GLX_SGIX_pbuffer");
extensionNameMap.put("GL_ARB_pixel_format", "GLX_SGIX_pbuffer"); // good enough
}
@@ -118,9 +118,9 @@ public abstract class X11GLXContext extends GLContextImpl {
return glXExt;
}
- protected Map/*<String, String>*/ getFunctionNameMap() { return functionNameMap; }
+ protected Map<String, String> getFunctionNameMap() { return functionNameMap; }
- protected Map/*<String, String>*/ getExtensionNameMap() { return extensionNameMap; }
+ protected Map<String, String> getExtensionNameMap() { return extensionNameMap; }
public final boolean isGLXVersionGreaterEqualOneThree() {
if(null == glXVersion) {
@@ -297,7 +297,6 @@ public abstract class X11GLXContext extends GLContextImpl {
GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
GLProfile glp = glCaps.getGLProfile();
- isVendorATI = factory.isGLXVendorATI(device);
if(config.getFBConfigID()<0) {
// not able to use FBConfig
@@ -319,14 +318,11 @@ public abstract class X11GLXContext extends GLContextImpl {
return true;
}
- int minor[] = new int[1];
- int major[] = new int[1];
- int ctp[] = new int[1];
boolean createContextARBTried = false;
// utilize the shared context's GLXExt in case it was using the ARB method and it already exists
if(null!=sharedContext && sharedContext.isCreatedWithARBMethod()) {
- contextHandle = createContextARB(share, direct, major, minor, ctp);
+ contextHandle = createContextARB(share, direct);
createContextARBTried = true;
if (DEBUG && 0!=contextHandle) {
System.err.println(getThreadName() + ": createContextImpl: OK (ARB, using sharedContext) share "+share);
@@ -352,7 +348,7 @@ public abstract class X11GLXContext extends GLContextImpl {
if ( isCreateContextAttribsARBAvailable &&
isExtensionAvailable("GLX_ARB_create_context") ) {
// initial ARB context creation
- contextHandle = createContextARB(share, direct, major, minor, ctp);
+ contextHandle = createContextARB(share, direct);
createContextARBTried=true;
if (DEBUG) {
if(0!=contextHandle) {
@@ -379,10 +375,10 @@ public abstract class X11GLXContext extends GLContextImpl {
if(glp.isGL3()) {
glXMakeContextCurrent(display, 0, 0, 0);
GLX.glXDestroyContext(display, temp_ctx);
- throw new GLException("X11GLXContext.createContextImpl failed, but context > GL2 requested "+getGLVersion(major[0], minor[0], ctp[0], "@creation")+", ");
+ throw new GLException("X11GLXContext.createContextImpl failed, but context > GL2 requested "+getGLVersion()+", ");
}
if(DEBUG) {
- System.err.println("X11GLXContext.createContextImpl failed, fall back to !ARB context "+getGLVersion(major[0], minor[0], ctp[0], "@creation"));
+ System.err.println("X11GLXContext.createContextImpl failed, fall back to !ARB context "+getGLVersion());
}
// continue with temp context for GL <= 3.0
@@ -472,12 +468,12 @@ public abstract class X11GLXContext extends GLContextImpl {
glXQueryExtensionsStringInitialized = false;
glXQueryExtensionsStringAvailable = false;
- GLXExtProcAddressTable table = null;
+ ProcAddressTable table = null;
synchronized(mappedContextTypeObjectLock) {
- table = (GLXExtProcAddressTable) mappedGLXProcAddress.get( key );
+ table = mappedGLXProcAddress.get( key );
}
if(null != table) {
- glXExtProcAddressTable = table;
+ glXExtProcAddressTable = (GLXExtProcAddressTable) table;
if(DEBUG) {
System.err.println(getThreadName() + ": !!! GLContext GLX ProcAddressTable reusing key("+key+") -> "+table.hashCode());
}
@@ -581,7 +577,4 @@ public abstract class X11GLXContext extends GLContextImpl {
//----------------------------------------------------------------------
// Internals only below this point
//
-
- private boolean isVendorATI = false;
-
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index 8203a440c..8d9de8144 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -212,7 +212,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
return new SharedResource(sharedDevice, sharedScreen, sharedDrawable, sharedContext, glXVersion, glXVendorName);
} catch (Throwable t) {
- throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources for "+connection, t);
+ throw new GLException("X11GLXDrawableFactory - Could not initialize shared resources for "+connection, t);
} finally {
sharedDevice.unlock();
}