aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-25 15:54:35 +0200
committerSven Gothel <[email protected]>2011-04-25 15:54:35 +0200
commit727ad54808664e3028fee64cfca98dd9f0bcfbf6 (patch)
tree94446464532d741d533038e35b3fabd3abb40d0e /src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
parente24ea541924d365c8a0896245436ca55e1575a22 (diff)
ShaderState: 'Update' vertexAttribMap on enable
ShaderProgram: - shaderCode's HashMap -> HashSet - adding HashSet for attached ShaderCode - link: allow relink, attachShader only if not yet attached - new add(gl, ShaderCode, ..) method, allowing compile/attach pre linkage - remove boxing of integer 'id', use generics style (warnings) - rename: glReplaceShader -> replaceShader, glUseProgram -> useProgram - fix: replaceShader - hashCode _is_ 'id' ShaderCode: - remove boxing of integer 'id', use generics style (warnings) - hashCode _is_ 'id' ShaderUtil: Use generics style (warnings), static names
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index c735de468..20b032a41 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -155,9 +155,9 @@ public class ShaderCode {
return res;
}
}
- Set binFmts = ShaderUtil.getShaderBinaryFormats(gl);
- for(Iterator iter=binFmts.iterator(); null==res && iter.hasNext(); ) {
- int bFmt = ((Integer)(iter.next())).intValue();
+ Set<Integer> binFmts = ShaderUtil.getShaderBinaryFormats(gl);
+ for(Iterator<Integer> iter=binFmts.iterator(); null==res && iter.hasNext(); ) {
+ int bFmt = iter.next().intValue();
String bFmtPath = getBinarySubPath(bFmt);
if(null==bFmtPath) continue;
binFileName = binRoot + '/' + bFmtPath + '/' + basename + "." + getFileSuffix(true, type);
@@ -174,16 +174,8 @@ public class ShaderCode {
/**
* returns the uniq shader id as an integer
- * @see #key()
*/
- public int id() { return id.intValue(); }
-
- /**
- * returns the uniq shader id as an Integer
- *
- * @see #id()
- */
- public Integer key() { return id; }
+ public int id() { return id; }
public int shaderType() { return shaderType; }
public String shaderTypeStr() { return shaderTypeStr(shaderType); }
@@ -239,7 +231,7 @@ public class ShaderCode {
shaderSource=null;
shaderBinaryFormat=-1;
shaderType=-1;
- id=null;
+ id=-1;
}
public boolean equals(Object obj) {
@@ -250,7 +242,7 @@ public class ShaderCode {
return false;
}
public int hashCode() {
- return id.intValue();
+ return id;
}
public String toString() {
StringBuffer buf = new StringBuffer("ShaderCode [id="+id+", type="+shaderTypeStr()+", valid="+valid+", shader: ");
@@ -359,12 +351,12 @@ public class ShaderCode {
protected int shaderBinaryFormat = -1;
protected IntBuffer shader = null;
protected int shaderType = -1;
- protected Integer id = null;
+ protected int id = -1;
protected boolean valid=false;
- private static synchronized Integer getNextID() {
- return new Integer(nextID++);
+ private static synchronized int getNextID() {
+ return nextID++;
}
protected static int nextID = 1;
}