public class MrShaderProgram extends MrComponent
Modifier and Type | Class and Description |
---|---|
protected static class |
MrShaderProgram.Data |
protected class |
MrShaderProgram.View |
mBound, mInitialized, mRenderingContext, TYPE_MESH, TYPE_SHADERPROGRAM, TYPE_TEXTURE
Constructor and Description |
---|
MrShaderProgram(java.lang.String name,
MrShader vertexShader,
MrShader fragmentShader)
Creates a new Shader Program
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(MrAttribute attribute)
Adds an attribute to this shader program
|
void |
addUniform(MrUniform uniform)
Adds a uniform to this shader program
|
void |
bind()
Binds the component
|
void |
bindUniforms(java.util.Map<java.lang.String,MrUniformKey> uniformKeys)
Passes data to GPU from values in the uniform keys
|
java.util.Map<java.lang.Integer,MrAttribute> |
getAttributes()
Gets all attributes defined in this shader program
|
MrComponent.Data |
getData()
Gets the data layer linked to this object
|
MrShader |
getFragmentShader()
Gets the Fragment Shader linked to this program
|
int |
getId()
Gets the ID of this Shader Program
|
java.lang.String |
getName()
Gets the name of this component
|
java.lang.String |
getType()
Gets the type of this component
|
java.util.Map<java.lang.String,MrUniform> |
getUniforms()
Gets all uniforms defined for this program
|
MrShader |
getVertexShader()
Gets the Vertex Shader linked to this program
|
MrComponent.View |
getView()
Gets the rendering layer linked to this object
|
initialize, isBound, isInitialized, unbind
public java.lang.String getType()
MrComponent
getType
in class MrComponent
public MrComponent.Data getData()
MrComponent
getData
in class MrComponent
public MrComponent.View getView()
MrComponent
getView
in class MrComponent
public java.lang.String getName()
MrComponent
getName
in class MrComponent
public void bind()
MrComponent
bind
in class MrComponent
public int getId()
public MrShader getVertexShader()
public MrShader getFragmentShader()
public java.util.Map<java.lang.String,MrUniform> getUniforms()
public void addUniform(MrUniform uniform)
uniform
- new uniformpublic void addAttribute(MrAttribute attribute)
attribute
- new attributepublic java.util.Map<java.lang.Integer,MrAttribute> getAttributes()
public void bindUniforms(java.util.Map<java.lang.String,MrUniformKey> uniformKeys)
uniformKeys
-