|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.graphics.opengl.GLShader
public class GLShader
A wrapper for OpenGL shaders, in the form of an GLRenderObject. In fact a wrapper around the GLShaderProgram, with added functionality for defining and setting uniforms. A GLShader can share the same GLShaderProgram with some other GLShader, yet it can set its own individual uniform values.
| Field Summary | |
|---|---|
(package private) ArrayList<String> |
declaredTypes
|
static int |
F
|
private float[] |
floatValue
|
static int |
FV
|
static int |
I
|
private int[] |
intValue
|
static int |
IV
|
private int |
nrOfUniforms
|
private GLShaderProgram |
prog
|
private int |
progId
|
private String |
shaderProgName
|
static int |
U1B
|
static int |
U1F
|
static int |
U1I
|
static int |
U2B
|
static int |
U2F
|
static int |
U2I
|
static int |
U3B
|
static int |
U3F
|
static int |
U3I
|
static int |
U4B
|
static int |
U4F
|
static int |
U4I
|
private int[] |
uBaseType
|
private int[] |
uLocation
|
private String[] |
uName
|
private int[] |
uOffset
|
private int[] |
uSize
|
private int[] |
uType
|
| Constructor Summary | |
|---|---|
GLShader(String shaderProg,
String... uniformNamesAndTypes)
Creates a new GLShader, with specified shader program name, and shader uniform names and parameter types. |
|
| Method Summary | |
|---|---|
void |
glInit(GLRenderContext gl)
OpenGL initialization: the shader program is initialized, activated, and current uniform values are passed on to the OpenGL shader. |
void |
glRender(GLRenderContext gl)
OpenGL rendering: the shader is activated, and current uniform values are passed on to the OpenGL shader. |
private void |
glSetUniformValue(GLRenderContext gl,
int i)
|
private void |
init(String[] uniformNames,
int[] uniformTypes)
Initializes the GLShader object, where the shader program name, and shader uniforms and types are specified. |
void |
setValue(String uniformName,
Object... vals)
Sets the value(s) for a single uniform, referenced by name |
void |
setValues(int[] intVals,
float[] floatVals)
Obsolete setValues method |
void |
setValues(Object... vals)
Sets uniform values, specified by an array of value Objects, which should match the uniform types for this GLShader |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private GLShaderProgram prog
private String shaderProgName
private int progId
private int nrOfUniforms
private String[] uName
private int[] uType
private int[] uBaseType
private int[] uSize
private int[] uLocation
private int[] uOffset
private int[] intValue
private float[] floatValue
public static final int I
public static final int F
public static final int IV
public static final int FV
public static final int U1I
public static final int U2I
public static final int U3I
public static final int U4I
public static final int U1F
public static final int U2F
public static final int U3F
public static final int U4F
public static final int U1B
public static final int U2B
public static final int U3B
public static final int U4B
ArrayList<String> declaredTypes
| Constructor Detail |
|---|
public GLShader(String shaderProg,
String... uniformNamesAndTypes)
| Method Detail |
|---|
private void init(String[] uniformNames,
int[] uniformTypes)
public String toString()
toString in class Object
public void setValue(String uniformName,
Object... vals)
public void setValues(Object... vals)
public void setValues(int[] intVals,
float[] floatVals)
private void glSetUniformValue(GLRenderContext gl,
int i)
public void glInit(GLRenderContext gl)
glInit in interface GLRenderObjectpublic final void glRender(GLRenderContext gl)
glRender in interface GLRenderObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||