Package codechicken.lib.render.shader
Class AbstractShaderObject
java.lang.Object
codechicken.lib.render.shader.NamedShaderObject
codechicken.lib.render.shader.AbstractShaderObject
- All Implemented Interfaces:
ShaderObject
- Direct Known Subclasses:
AssetShaderObject,SimpleShaderObject
Created by covers1624 on 24/5/20.
-
Nested Class Summary
Nested classes/interfaces inherited from interface codechicken.lib.render.shader.ShaderObject
ShaderObject.ShaderType, ShaderObject.StandardShaderType -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractShaderObject(String name, ShaderObject.ShaderType type, Collection<UniformPair> uniforms) -
Method Summary
Modifier and TypeMethodDescriptionvoidalloc()Allocates and compiles thisShaderObject.intGets the GL id for thisShaderObject.protected abstract StringbooleanisDirty()Checks if this shader is dirty and requires re-compiling.voidonLink(int programId) Called when thisShaderObjectis linked to aShaderProgram.Methods inherited from class codechicken.lib.render.shader.NamedShaderObject
getName, getShaderType, getUniforms
-
Field Details
-
shaderId
protected int shaderId -
dirty
protected boolean dirty
-
-
Constructor Details
-
AbstractShaderObject
protected AbstractShaderObject(String name, ShaderObject.ShaderType type, Collection<UniformPair> uniforms)
-
-
Method Details
-
isDirty
public boolean isDirty()Description copied from interface:ShaderObjectChecks if this shader is dirty and requires re-compiling.- Returns:
- If this shader is dirty.
-
alloc
public void alloc()Description copied from interface:ShaderObjectAllocates and compiles thisShaderObject. Does nothing if the shader is already compiled. -
getShaderID
public int getShaderID()Description copied from interface:ShaderObjectGets the GL id for thisShaderObject.- Returns:
- The id, -1 of not allocated.
-
onLink
public void onLink(int programId) Description copied from interface:ShaderObjectCalled when thisShaderObjectis linked to aShaderProgram.- Parameters:
programId- The GL id of the program.
-
getSource
-