aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/curve/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java4
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java16
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java41
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java20
4 files changed, 41 insertions, 40 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
index 568b8ddac..8f3a10d9d 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
@@ -75,7 +75,7 @@ public abstract class GLRegion extends Region {
protected final TextureSequence colorTexSeq;
- protected GLRegion(int renderModes, TextureSequence colorTexSeq) {
+ protected GLRegion(final int renderModes, final TextureSequence colorTexSeq) {
super(renderModes);
this.colorTexSeq = colorTexSeq;
}
@@ -103,7 +103,7 @@ public abstract class GLRegion extends Region {
/**
* Delete and clear the associated OGL objects.
*/
- public final void destroy(GL2ES2 gl) {
+ public final void destroy(final GL2ES2 gl) {
clear(gl);
destroyImpl(gl);
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
index 754eb56e8..9a175c030 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -207,7 +207,7 @@ public class RegionRenderer {
initialized = true;
}
- public final void destroy(GL2ES2 gl) {
+ public final void destroy(final GL2ES2 gl) {
if(!initialized){
if(DEBUG_INSTANCE) {
System.err.println("TextRenderer: Not initialized!");
@@ -234,7 +234,7 @@ public class RegionRenderer {
* </p>
* @see #create(RenderState, GLCallback, GLCallback)
*/
- public final void enable(GL2ES2 gl, boolean enable) {
+ public final void enable(final GL2ES2 gl, final boolean enable) {
if( enable ) {
if( null != enableCallback ) {
enableCallback.run(gl, this);
@@ -253,12 +253,12 @@ public class RegionRenderer {
}
/** No PMVMatrix operation is performed here. PMVMatrix is marked dirty. */
- public final void reshapeNotify(int width, int height) {
+ public final void reshapeNotify(final int width, final int height) {
this.vp_width = width;
this.vp_height = height;
}
- public final void reshapePerspective(float angle, int width, int height, float near, float far) {
+ public final void reshapePerspective(final float angle, final int width, final int height, final float near, final float far) {
this.vp_width = width;
this.vp_height = height;
final float ratio = (float)width/(float)height;
@@ -268,7 +268,7 @@ public class RegionRenderer {
p.gluPerspective(angle, ratio, near, far);
}
- public final void reshapeOrtho(int width, int height, float near, float far) {
+ public final void reshapeOrtho(final int width, final int height, final float near, final float far) {
this.vp_width = width;
this.vp_height = height;
final PMVMatrix p = rs.getMatrix();
@@ -298,7 +298,7 @@ public class RegionRenderer {
// FIXME: Really required to have sampler2D def. precision ? If not, we can drop getFragmentShaderPrecision(..) and use default ShaderCode ..
private static final String es2_precision_fp = "\nprecision mediump float;\nprecision mediump int;\nprecision mediump sampler2D;\n";
- private final String getFragmentShaderPrecision(GL2ES2 gl) {
+ private final String getFragmentShaderPrecision(final GL2ES2 gl) {
if( gl.isGLES() ) {
return es2_precision_fp;
}
@@ -489,7 +489,7 @@ public class RegionRenderer {
try {
posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "uniforms.glsl");
posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "varyings.glsl");
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new RuntimeException("Failed to read: includes", ioe);
}
if( 0 > posFp ) {
@@ -514,7 +514,7 @@ public class RegionRenderer {
}
try {
posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, shaderSegment);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new RuntimeException("Failed to read: "+shaderSegment, ioe);
}
if( 0 > posFp ) {
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
index f991855c0..6ff9bf9cd 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
@@ -34,6 +34,7 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLException;
import javax.media.opengl.GLUniformData;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.graph.curve.opengl.shader.UniformNames;
import com.jogamp.common.os.Platform;
@@ -64,7 +65,7 @@ public class RenderState {
* </p>
*/
public static final int BITHINT_BLENDING_ENABLED = 1 << 0 ;
-
+
/**
* Bitfield hint, {@link #isHintMaskSet(int) if set}
* stating globally <i>enabled</i> {@link GL#GL_DEPTH_TEST}, otherwise <i>disabled</i>.
@@ -81,15 +82,15 @@ public class RenderState {
*/
public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED = 1 << 1 ;
- public static RenderState createRenderState(Vertex.Factory<? extends Vertex> pointFactory) {
+ public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory) {
return new RenderState(pointFactory, null);
}
- public static RenderState createRenderState(Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
+ public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory, final PMVMatrix pmvMatrix) {
return new RenderState(pointFactory, pmvMatrix);
}
- public static final RenderState getRenderState(GL2ES2 gl) {
+ public static final RenderState getRenderState(final GL2ES2 gl) {
return (RenderState) gl.getContext().getAttachedObject(thisKey);
}
@@ -167,13 +168,13 @@ public class RenderState {
return res;
}
- public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
+ public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) {
if(null==sb) {
sb = new StringBuilder();
}
- sb.append("ProgramLocal[rsID ").append(rsId).append(Platform.NEWLINE);
+ sb.append("ProgramLocal[rsID ").append(rsId).append(PlatformPropsImpl.NEWLINE);
// pmvMatrix.toString(sb, "%.2f");
- sb.append(gcu_PMVMatrix01).append(", ").append(Platform.NEWLINE);
+ sb.append(gcu_PMVMatrix01).append(", ").append(PlatformPropsImpl.NEWLINE);
sb.append(gcu_ColorStatic).append(", ");
sb.append(gcu_Weight).append("]");
return sb;
@@ -185,7 +186,7 @@ public class RenderState {
}
}
- protected RenderState(Vertex.Factory<? extends Vertex> vertexFactory, PMVMatrix pmvMatrix) {
+ protected RenderState(final Vertex.Factory<? extends Vertex> vertexFactory, final PMVMatrix pmvMatrix) {
this.id = getNextID();
this.sp = null;
this.vertexFactory = vertexFactory;
@@ -226,11 +227,11 @@ public class RenderState {
public final PMVMatrix getMatrix() { return pmvMatrix; }
- public static boolean isWeightValid(float v) {
+ public static boolean isWeightValid(final float v) {
return 0.0f <= v && v <= 1.9f ;
}
public final float getWeight() { return weight[0]; }
- public final void setWeight(float v) {
+ public final void setWeight(final float v) {
if( !isWeightValid(v) ) {
throw new IllegalArgumentException("Weight out of range");
}
@@ -238,11 +239,11 @@ public class RenderState {
}
- public final float[] getColorStatic(float[] rgbaColor) {
+ public final float[] getColorStatic(final float[] rgbaColor) {
System.arraycopy(colorStatic, 0, rgbaColor, 0, 4);
return rgbaColor;
}
- public final void setColorStatic(float r, float g, float b, float a){
+ public final void setColorStatic(final float r, final float g, final float b, final float a){
colorStatic[0] = r;
colorStatic[1] = g;
colorStatic[2] = b;
@@ -301,7 +302,7 @@ public class RenderState {
* @param throwOnError TODO
* @return true if no error occured, i.e. all locations found, otherwise false.
*/
- public final boolean updateAttributeLoc(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, boolean throwOnError) {
+ public final boolean updateAttributeLoc(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, final boolean throwOnError) {
if( updateLocation || 0 > data.getLocation() ) {
final boolean ok = 0 <= data.setLocation(gl, sp.program());
if( throwOnError && !ok ) {
@@ -314,29 +315,29 @@ public class RenderState {
}
- public final boolean isHintMaskSet(int mask) {
+ public final boolean isHintMaskSet(final int mask) {
return mask == ( hintBitfield & mask );
}
- public final void setHintMask(int mask) {
+ public final void setHintMask(final int mask) {
hintBitfield |= mask;
}
- public final void clearHintMask(int mask) {
+ public final void clearHintMask(final int mask) {
hintBitfield &= ~mask;
}
- public void destroy(GL2ES2 gl) {
+ public void destroy(final GL2ES2 gl) {
if( null != sp ) {
sp.destroy(gl);
sp = null;
}
}
- public final RenderState attachTo(GL2ES2 gl) {
+ public final RenderState attachTo(final GL2ES2 gl) {
return (RenderState) gl.getContext().attachObject(thisKey, this);
}
- public final boolean detachFrom(GL2ES2 gl) {
- RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey);
+ public final boolean detachFrom(final GL2ES2 gl) {
+ final RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey);
if(_rs == this) {
gl.getContext().detachObject(thisKey);
return true;
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
index aadbecc91..0fa1f49f1 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
@@ -88,7 +88,7 @@ public class TextRegionUtil {
*/
public static void processString(final ShapeVisitor visitor, final AffineTransform transform,
final Font font, final float pixelSize, final CharSequence str,
- final AffineTransform temp1, AffineTransform temp2) {
+ final AffineTransform temp1, final AffineTransform temp2) {
final int charCount = str.length();
// region.setFlipped(true);
@@ -248,7 +248,7 @@ public class TextRegionUtil {
/**
* Clear all cached {@link GLRegions}.
*/
- public void clear(GL2ES2 gl) {
+ public void clear(final GL2ES2 gl) {
// fluchCache(gl) already called
final Iterator<GLRegion> iterator = stringCacheMap.values().iterator();
while(iterator.hasNext()){
@@ -269,7 +269,7 @@ public class TextRegionUtil {
*
* @see #DEFAULT_CACHE_LIMIT
*/
- public final void setCacheLimit(int newLimit ) { stringCacheLimit = newLimit; }
+ public final void setCacheLimit(final int newLimit ) { stringCacheLimit = newLimit; }
/**
* Sets the cache limit, see {@link #setCacheLimit(int)} and validates the cache.
@@ -279,7 +279,7 @@ public class TextRegionUtil {
* @param gl current GL used to remove cached objects if required
* @param newLimit new cache size
*/
- public final void setCacheLimit(GL2ES2 gl, int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); }
+ public final void setCacheLimit(final GL2ES2 gl, final int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); }
/**
* @return the current cache limit
@@ -291,7 +291,7 @@ public class TextRegionUtil {
*/
public final int getCacheSize() { return stringCacheArray.size(); }
- protected final void validateCache(GL2ES2 gl, int space) {
+ protected final void validateCache(final GL2ES2 gl, final int space) {
if ( getCacheLimit() > 0 ) {
while ( getCacheSize() + space > getCacheLimit() ) {
removeCachedRegion(gl, 0);
@@ -299,11 +299,11 @@ public class TextRegionUtil {
}
}
- protected final GLRegion getCachedRegion(Font font, CharSequence str, float pixelSize, int special) {
+ protected final GLRegion getCachedRegion(final Font font, final CharSequence str, final float pixelSize, final int special) {
return stringCacheMap.get(getKey(font, str, pixelSize, special));
}
- protected final void addCachedRegion(GL2ES2 gl, Font font, CharSequence str, float pixelSize, int special, GLRegion glyphString) {
+ protected final void addCachedRegion(final GL2ES2 gl, final Font font, final CharSequence str, final float pixelSize, final int special, final GLRegion glyphString) {
if ( 0 != getCacheLimit() ) {
final String key = getKey(font, str, pixelSize, special);
final GLRegion oldRegion = stringCacheMap.put(key, glyphString);
@@ -315,7 +315,7 @@ public class TextRegionUtil {
}
}
- protected final void removeCachedRegion(GL2ES2 gl, Font font, CharSequence str, int pixelSize, int special) {
+ protected final void removeCachedRegion(final GL2ES2 gl, final Font font, final CharSequence str, final int pixelSize, final int special) {
final String key = getKey(font, str, pixelSize, special);
final GLRegion region = stringCacheMap.remove(key);
if(null != region) {
@@ -324,7 +324,7 @@ public class TextRegionUtil {
stringCacheArray.remove(key);
}
- protected final void removeCachedRegion(GL2ES2 gl, int idx) {
+ protected final void removeCachedRegion(final GL2ES2 gl, final int idx) {
final String key = stringCacheArray.remove(idx);
if( null != key ) {
final GLRegion region = stringCacheMap.remove(key);
@@ -334,7 +334,7 @@ public class TextRegionUtil {
}
}
- protected final String getKey(Font font, CharSequence str, float pixelSize, int special) {
+ protected final String getKey(final Font font, final CharSequence str, final float pixelSize, final int special) {
final StringBuilder sb = new StringBuilder();
return font.getName(sb, Font.NAME_UNIQUNAME)
.append(".").append(str.hashCode()).append(".").append(Float.floatToIntBits(pixelSize)).append(special).toString();