|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.opengl.util.glsl.ShaderProgram
public class ShaderProgram
Constructor Summary | |
---|---|
ShaderProgram()
|
Method Summary | |
---|---|
boolean |
add(GL2ES2 gl,
ShaderCode shaderCode,
PrintStream verboseOut)
Adds a new shader to a this non running program. |
void |
add(ShaderCode shaderCode)
Adds a new shader to this program. |
boolean |
contains(ShaderCode shaderCode)
|
void |
destroy(GL2ES2 gl)
Detaches all shader codes and deletes the program. |
boolean |
equals(Object obj)
|
ShaderCode |
getShader(int id)
Warning slow O(n) operation .. |
int |
hashCode()
|
int |
id()
returns the uniq shader id as an integer |
void |
init(GL2ES2 gl)
Creates the empty GL program object using GL2ES2.glCreateProgram() |
boolean |
inUse()
|
boolean |
link(GL2ES2 gl,
PrintStream verboseOut)
Links the shader code to the program. |
boolean |
linked()
|
int |
program()
|
void |
release(GL2ES2 gl)
Detaches all shader codes and deletes the program. |
void |
release(GL2ES2 gl,
boolean releaseShaderToo)
Detaches all shader codes and deletes the program. |
boolean |
replaceShader(GL2ES2 gl,
ShaderCode oldShader,
ShaderCode newShader,
PrintStream verboseOut)
Replace a shader in a program and re-links the program. |
String |
toString()
|
StringBuilder |
toString(StringBuilder sb)
|
void |
useProgram(GL2ES2 gl,
boolean on)
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ShaderProgram()
Method Detail |
---|
public boolean linked()
public boolean inUse()
public int program()
public int id()
public void destroy(GL2ES2 gl)
release(GL2ES2, boolean)
public void release(GL2ES2 gl)
release(GL2ES2, boolean)
public void release(GL2ES2 gl, boolean releaseShaderToo)
public void add(ShaderCode shaderCode) throws GLException
This command does not compile and attach the shader,
use #add(GL2ES2, ShaderCode)
for this purpose.
GLException
public boolean contains(ShaderCode shaderCode)
public ShaderCode getShader(int id)
id
-
public final void init(GL2ES2 gl)
GL2ES2.glCreateProgram()
gl
- public boolean add(GL2ES2 gl, ShaderCode shaderCode, PrintStream verboseOut)
Compiles and attaches the shader, if not done yet.
public boolean replaceShader(GL2ES2 gl, ShaderCode oldShader, ShaderCode newShader, PrintStream verboseOut)
gl
- oldShader
- the to be replace ShadernewShader
- the new ShaderCodeverboseOut
- the optional verbose output stream
ShaderState#glEnableVertexAttribArray
,
ShaderState#glDisableVertexAttribArray
,
ShaderState#glVertexAttribPointer
,
ShaderState#getVertexAttribPointer
,
ShaderState#glReleaseAllVertexAttributes
,
ShaderState#glResetAllVertexAttributes
,
ShaderState#glResetAllVertexAttributes
,
ShaderState#glResetAllVertexAttributes
public boolean link(GL2ES2 gl, PrintStream verboseOut)
Compiles and attaches the shader code to the program if not done by yet
Within this process, all GL resources (shader and program objects) are created if necessary.
gl
- verboseOut
-
init(GL2ES2)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public StringBuilder toString(StringBuilder sb)
public String toString()
toString
in class Object
public void useProgram(GL2ES2 gl, boolean on)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |