Class GlProgram
java.lang.Object
com.jozufozu.flywheel.backend.gl.GlObject
com.jozufozu.flywheel.backend.gl.shader.GlProgram
- Direct Known Subclasses:
WorldProgram
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceGlProgram.Factory<P extends GlProgram>A factory interface to create aGlProgram. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGlProgram(net.minecraft.resources.ResourceLocation name, int handle) -
Method Summary
Modifier and TypeMethodDescriptionvoidbind()protected voiddeleteInternal(int handle) intgetUniformLocation(String uniform) Retrieves the index of the uniform with the given name.intsetSamplerBinding(String name, int binding) Binds a sampler uniform to the given texture unit.toString()static voidunbind()protected static voiduploadMatrixUniform(int uniform, com.mojang.math.Matrix4f mat) Methods inherited from class com.jozufozu.flywheel.backend.gl.GlObject
checkHandle, delete, handle, invalidateHandle, isInvalid, setHandle
-
Field Details
-
name
public final net.minecraft.resources.ResourceLocation name
-
-
Constructor Details
-
GlProgram
protected GlProgram(net.minecraft.resources.ResourceLocation name, int handle)
-
-
Method Details
-
bind
public void bind() -
unbind
public static void unbind() -
getUniformLocation
Retrieves the index of the uniform with the given name.- Parameters:
uniform- The name of the uniform to find the index of- Returns:
- The uniform's index
-
setSamplerBinding
Binds a sampler uniform to the given texture unit.- Parameters:
name- The name of the sampler uniform.binding- The index of the texture unit.- Returns:
- The sampler uniform's index.
- Throws:
NullPointerException- If no uniform exists with the given name.
-
uploadMatrixUniform
protected static void uploadMatrixUniform(int uniform, com.mojang.math.Matrix4f mat) -
deleteInternal
protected void deleteInternal(int handle) - Specified by:
deleteInternalin classGlObject
-
toString
-