Package codechicken.lib.render.shader
Interface ShaderObject
- All Known Implementing Classes:
AbstractShaderObject,AssetShaderObject,BinaryShaderObject,NamedShaderObject,SimpleShaderObject
public interface ShaderObject
Created by covers1624 on 24/5/20.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a Shader Type.static enumStandard ShaderTypes. -
Method Summary
Modifier and TypeMethodDescriptionvoidalloc()Allocates and compiles thisShaderObject.getName()A simple identifier for thisShaderObject, used for logging.intGets the GL id for thisShaderObject.Gets theShaderObject.ShaderTypefor this shader.com.google.common.collect.ImmutableList<UniformPair> Gets allUniformPairs this shader exposes.booleanisDirty()Checks if this shader is dirty and requires re-compiling.voidonLink(int programId) Called when thisShaderObjectis linked to aShaderProgram.
-
Method Details
-
getName
String getName()A simple identifier for thisShaderObject, used for logging.- Returns:
- The name.
-
getShaderType
ShaderObject.ShaderType getShaderType()Gets theShaderObject.ShaderTypefor this shader.- Returns:
- The
ShaderObject.ShaderType.
-
getUniforms
com.google.common.collect.ImmutableList<UniformPair> getUniforms()Gets allUniformPairs this shader exposes. It is expected that aShaderObjectwill not dynamically change the uniforms it exposes over its lifetime. Doing so is not enforced, but will break the Uniform pipeline.- Returns:
- The
UniformPairs.
-
isDirty
boolean isDirty()Checks if this shader is dirty and requires re-compiling.- Returns:
- If this shader is dirty.
-
alloc
void alloc()Allocates and compiles thisShaderObject. Does nothing if the shader is already compiled. -
getShaderID
int getShaderID()Gets the GL id for thisShaderObject.- Returns:
- The id, -1 of not allocated.
-
onLink
void onLink(int programId) Called when thisShaderObjectis linked to aShaderProgram.- Parameters:
programId- The GL id of the program.
-