|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.neovisionaries.android.opengl.Uniform
public class Uniform
A class to manipulate a uniform variable in OpenGL Shader Language.
// E X A M P L E // Get a program from somewhere.Programprogram = ...; // Get an accessor to a uniform variable.Uniformpos = program.getUniform("pos"); // Set a value to the uniform variable. // It is assumed here that pos is a vec2 variable. pos.set(1.0f, 1.0f);
| Constructor Summary | |
|---|---|
Uniform(Program program,
String name)
A constructor. |
|
| Method Summary | |
|---|---|
float[] |
get(Program program,
float[] params)
Get the value of a uniform variable. |
float[] |
get(Program program,
float[] params,
int offset)
Get the value of a uniform variable. |
FloatBuffer |
get(Program program,
FloatBuffer params)
Get the value of a uniform variable. |
int[] |
get(Program program,
int[] params)
Get the value of a uniform variable. |
int[] |
get(Program program,
int[] params,
int offset)
Get the value of a uniform variable. |
IntBuffer |
get(Program program,
IntBuffer params)
Get the value of a uniform variable. |
int |
getLocation()
Get the location of this uniform. |
void |
set(float x)
This method is an alias of set1(float). |
void |
set(float[] values)
Set a value to a non-array uniform variable. |
void |
set(float x,
float y)
This method is an alias of set2(float, float). |
void |
set(float x,
float y,
float z)
This method is an alias of set3(float, float, float). |
void |
set(float x,
float y,
float z,
float w)
This method is an alias of set4(float, float, float, float). |
void |
set(int x)
This method is an alias of set1(int). |
void |
set(int[] values)
Set a value to a non-array uniform variable. |
void |
set(int x,
int y)
This method is an alias of set2(int, int). |
void |
set(int x,
int y,
int z)
This method is an alias of set3(int, int, int). |
void |
set(int x,
int y,
int z,
int w)
This method is an alias of set4(int, int, int, int). |
void |
set1(float x)
Set a value to a uniform variable (float). |
void |
set1(float[] values)
Set a value to a uniform variable (float array). |
void |
set1(int x)
Set a value to a uniform variable (int). |
void |
set1(int[] values)
Set a value to a uniform variable (int array). |
void |
set1(int count,
float[] values,
int offset)
Set a value to a uniform variable (float array). |
void |
set1(int count,
FloatBuffer values)
Set a value to a uniform variable (float array). |
void |
set1(int count,
int[] values,
int offset)
Set a value to a uniform variable (int array). |
void |
set1(int count,
IntBuffer values)
Set a value to a uniform variable (int array). |
void |
set2(float[] values)
Set a value to a uniform variable (float vec2 array). |
void |
set2(float x,
float y)
Set a value to a uniform variable (float vec2). |
void |
set2(int[] values)
Set a value to a uniform variable (int vec2 array). |
void |
set2(int count,
float[] values,
int offset)
Set a value to a uniform variable (float vec2 array). |
void |
set2(int count,
FloatBuffer values)
Set a value to a uniform variable (float vec2 array). |
void |
set2(int x,
int y)
Set a value to a uniform variable (int vec2). |
void |
set2(int count,
int[] values,
int offset)
Set a value to a uniform variable (int vec2 array). |
void |
set2(int count,
IntBuffer values)
Set a value to a uniform variable (int vec2 array). |
void |
set3(float[] values)
Set a value to a uniform variable (float vec3 array). |
void |
set3(float x,
float y,
float z)
Set a value to a uniform variable (float vec3). |
void |
set3(int[] values)
Set a value to a uniform variable (int vec3 array). |
void |
set3(int count,
float[] values,
int offset)
Set a value to a uniform variable (float vec3 array). |
void |
set3(int count,
FloatBuffer values)
Set a value to a uniform variable (float vec3 array). |
void |
set3(int count,
int[] values,
int offset)
Set a value to a uniform variable (int vec3 array). |
void |
set3(int count,
IntBuffer values)
Set a value to a uniform variable (int vec3 array). |
void |
set3(int x,
int y,
int z)
Set a value to a uniform variable (int vec3). |
void |
set4(float[] values)
Set a value to a uniform variable (float vec4 array). |
void |
set4(float x,
float y,
float z,
float w)
Set a value to a uniform variable (float vec4). |
void |
set4(int[] values)
Set a value to a uniform variable (int vec4 array). |
void |
set4(int count,
float[] values,
int offset)
Set a value to a uniform variable (float vec4 array). |
void |
set4(int count,
FloatBuffer values)
Set a value to a uniform variable (float vec4 array). |
void |
set4(int count,
int[] values,
int offset)
Set a value to a uniform variable (int vec4 array). |
void |
set4(int count,
IntBuffer values)
Set a value to a uniform variable (int vec4 array). |
void |
set4(int x,
int y,
int z,
int w)
Set a value to a uniform variable (int vec4). |
void |
setMatrix(float[] values)
Set a value to a non-array, matrix uniform variable. |
void |
setMatrix2(float[] values)
Set a value to a uniform variable (mat2 array). |
void |
setMatrix2(int count,
float[] values,
int offset)
Set a value to a uniform variable (mat2 array). |
void |
setMatrix2(int count,
FloatBuffer values)
Set a value to a uniform variable (mat2 array). |
void |
setMatrix3(float[] values)
Set a value to a uniform variable (mat3 array). |
void |
setMatrix3(int count,
float[] values,
int offset)
Set a value to a uniform variable (mat3 array). |
void |
setMatrix3(int count,
FloatBuffer values)
Set a value to a uniform variable (mat3 array). |
void |
setMatrix4(float[] values)
Set a value to a uniform variable (mat4 array). |
void |
setMatrix4(int count,
float[] values,
int offset)
Set a value to a uniform variable (mat4 array). |
void |
setMatrix4(int count,
FloatBuffer values)
Set a value to a uniform variable (mat4 array). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Uniform(Program program,
String name)
throws GLESException
program - name -
IllegalArgumentException - Either or both of the arguments are null.
GLESException - There is no such a uniform variable having the specified name.Program.getUniform(String)| Method Detail |
|---|
public int getLocation()
public FloatBuffer get(Program program,
FloatBuffer params)
program - params -
IllegalArgumentException - Either or both of the arguments are null.
IllegalStateException - The state of the program is not LINKED.
public float[] get(Program program,
float[] params,
int offset)
program - params - offset -
IllegalArgumentException - Either or both of the arguments are null, or 'offset'
is equal to or greater than the length of 'params'.
IllegalStateException - The state of the program is not LINKED.
public float[] get(Program program,
float[] params)
get(program, params, 0).
program - params -
IllegalArgumentException - Either or both of the arguments are null, or the
length of 'params' is 0.get(Program, float[], int)
public IntBuffer get(Program program,
IntBuffer params)
program - params -
IllegalArgumentException - Either or both of the arguments are null.
IllegalStateException - The state of the program is not LINKED.
public int[] get(Program program,
int[] params,
int offset)
program - params - offset -
IllegalArgumentException - Either or both of the arguments are null, or 'offset'
is equal to or greater than the length of 'params'.
IllegalStateException - The state of the program is not LINKED.
public int[] get(Program program,
int[] params)
get(program, params, 0).
program - params -
IllegalArgumentException - Either or both of the arguments are null, or the
length of 'params' is 0.get(Program, int[], int)public void set1(float x)
x -
public void set1(int count,
FloatBuffer values)
count - values -
public void set1(int count,
float[] values,
int offset)
count - values - offset - public void set1(float[] values)
set1(values.length, values, 0).
values - set1(int, float[], int)public void set1(int x)
x -
public void set1(int count,
IntBuffer values)
count - values -
public void set1(int count,
int[] values,
int offset)
count - values - offset - public void set1(int[] values)
set1(values.length, values, 0).
values - set1(int, int[], int)
public void set2(float x,
float y)
x - y -
public void set2(int count,
FloatBuffer values)
count - values -
public void set2(int count,
float[] values,
int offset)
count - values - offset - public void set2(float[] values)
set2(values.length / 2, values, 0).
values - set2(int, float[], int)
public void set2(int x,
int y)
x - y -
public void set2(int count,
IntBuffer values)
count - values -
public void set2(int count,
int[] values,
int offset)
count - values - offset - public void set2(int[] values)
set2(values.length / 2, values, 0).
values - set2(int, int[], int)
public void set3(float x,
float y,
float z)
x - y - z -
public void set3(int count,
FloatBuffer values)
count - values -
public void set3(int count,
float[] values,
int offset)
count - values - offset - public void set3(float[] values)
set3(values.length / 3, values, 0).
values - set3(int, float[], int)
public void set3(int x,
int y,
int z)
x - y - z -
public void set3(int count,
IntBuffer values)
count - values -
public void set3(int count,
int[] values,
int offset)
count - values - offset - public void set3(int[] values)
set3(values.length / 3, values, 0).
values - set3(int, int[], int)
public void set4(float x,
float y,
float z,
float w)
x - y - z - w -
public void set4(int count,
FloatBuffer values)
count - values -
public void set4(int count,
float[] values,
int offset)
count - values - offset - public void set4(float[] values)
set4(values.lenth / 4, values, 0).
values - set4(int, float[], int)
public void set4(int x,
int y,
int z,
int w)
x - y - z - w -
public void set4(int count,
IntBuffer values)
count - values -
public void set4(int count,
int[] values,
int offset)
count - values - offset - public void set4(int[] values)
set4(values.lenth / 4, values, 0).
values - set4(int, int[], int)
public void setMatrix2(int count,
FloatBuffer values)
count - values -
public void setMatrix2(int count,
float[] values,
int offset)
count - values - offset - public void setMatrix2(float[] values)
setMatrix2(values.length / (2 * 2), values, 0).
values - setMatrix2(int, float[], int)
public void setMatrix3(int count,
FloatBuffer values)
count - values -
public void setMatrix3(int count,
float[] values,
int offset)
count - values - offset - public void setMatrix3(float[] values)
setMatrix3(values.length / (3 * 3), values, 0).
values - setMatrix3(int, float[], int)
public void setMatrix4(int count,
FloatBuffer values)
count - values -
public void setMatrix4(int count,
float[] values,
int offset)
count - values - offset - public void setMatrix4(float[] values)
setMatrix4(values.length / (4 * 4), values, 0).
values - setMatrix4(int, float[], int)public void set(float x)
set1(float).
x - set1(float)public void set(int x)
set1(int).
x - set1(int)
public void set(float x,
float y)
set2(float, float).
x - y - set2(float, float)
public void set(int x,
int y)
set2(int, int).
x - y - set2(int, int)
public void set(float x,
float y,
float z)
set3(float, float, float).
x - y - z - set3(float, float, float)
public void set(int x,
int y,
int z)
set3(int, int, int).
x - y - z - set3(int, int, int)
public void set(float x,
float y,
float z,
float w)
set4(float, float, float, float).
x - y - z - w - set4(float, float, float, float)
public void set(int x,
int y,
int z,
int w)
set4(int, int, int, int).
x - y - z - w - set4(int, int, int, int)public void set(float[] values)
| values.length | Method to call |
|---|---|
| 1 | set1(values[0]) |
| 2 | set2(values[0], values[1]) |
| 3 | set3(values[0], values[1], values[2]) |
| 4 | set4(values[0], values[1], values[2], values[3]) |
values -
IllegalArgumentException - The argument is null, or its length is none of the ones
listed in the above table.public void set(int[] values)
| values.length | Method to call |
|---|---|
| 1 | set1(values[0]) |
| 2 | set2(values[0], values[1]) |
| 3 | set3(values[0], values[1], values[2]) |
| 4 | set4(values[0], values[1], values[2], values[3]) |
values -
IllegalArgumentException - The argument is null, or its length is none of the ones
listed in the above table.public void setMatrix(float[] values)
| values.length | Method to call |
|---|---|
| 4 | setMatrix2(values) |
| 9 | setMatrix3(values) |
| 16 | setMatrix4(values) |
values -
IllegalArgumentException - The argument is null, or its length is none of the ones
listed in the above table.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||