public static class Program.BaseProgramBuilder extends Object
Modifier | Constructor and Description |
---|---|
protected |
BaseProgramBuilder(RenderScript rs) |
Modifier and Type | Method and Description |
---|---|
Program.BaseProgramBuilder |
addConstant(Type t)
Adds constant (uniform) inputs to the program
|
Program.BaseProgramBuilder |
addTexture(Program.TextureType texType)
Adds a texture input to the Program
|
Program.BaseProgramBuilder |
addTexture(Program.TextureType texType,
String texName)
Adds a texture input to the Program
|
int |
getCurrentConstantIndex()
Queries the index of the last added constant buffer type
|
int |
getCurrentTextureIndex()
Queries the index of the last added texture type
|
protected void |
initProgram(Program p) |
Program.BaseProgramBuilder |
setShader(Resources resources,
int resourceID)
Sets the GLSL shader code to be used in the program
|
Program.BaseProgramBuilder |
setShader(String s)
Sets the GLSL shader code to be used in the program
|
protected BaseProgramBuilder(RenderScript rs)
public Program.BaseProgramBuilder setShader(String s)
s
- GLSL shader stringpublic Program.BaseProgramBuilder setShader(Resources resources, int resourceID)
resources
- application resourcesresourceID
- id of the file containing GLSL shader codepublic int getCurrentConstantIndex()
public int getCurrentTextureIndex()
public Program.BaseProgramBuilder addConstant(Type t) throws IllegalStateException
t
- Type that describes the layout of the Allocation
object to be used as constant inputs to the ProgramIllegalStateException
public Program.BaseProgramBuilder addTexture(Program.TextureType texType) throws IllegalArgumentException
texType
- describes that the texture to append it (2D,
Cubemap, etc.)IllegalArgumentException
public Program.BaseProgramBuilder addTexture(Program.TextureType texType, String texName) throws IllegalArgumentException
texType
- describes that the texture to append it (2D,
Cubemap, etc.)texName
- what the texture should be called in the
shaderIllegalArgumentException
protected void initProgram(Program p)