Class ProgramContext
java.lang.Object
com.jozufozu.flywheel.core.compile.ProgramContext
Represents the entire context of a program's usage.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal floatfinal StateSnapshotfinal ProgramSpecfinal VertexType -
Constructor Summary
ConstructorsConstructorDescriptionProgramContext(ProgramSpec spec, float alphaDiscard, VertexType vertexType, StateSnapshot ctx) -
Method Summary
Modifier and TypeMethodDescriptionstatic ProgramContextcreate(net.minecraft.resources.ResourceLocation programName, VertexType vertexType, RenderLayer layer) Creates a compilation context for the given program, vertex type and render layer.booleanstatic floatgetAlphaDiscard(RenderLayer layer) Gets the alpha discard threshold for the given render layer.inthashCode()toString()
-
Field Details
-
spec
-
alphaDiscard
public final float alphaDiscard -
vertexType
-
ctx
-
-
Constructor Details
-
ProgramContext
public ProgramContext(ProgramSpec spec, float alphaDiscard, VertexType vertexType, StateSnapshot ctx) - Parameters:
spec- The program to use.alphaDiscard- Alpha threshold below which pixels are discarded.vertexType- The vertexType the program should be adapted for.ctx- A snapshot of the game state.
-
-
Method Details
-
create
public static ProgramContext create(net.minecraft.resources.ResourceLocation programName, VertexType vertexType, @Nullable RenderLayer layer) Creates a compilation context for the given program, vertex type and render layer.- Parameters:
programName- The name of the program to use.vertexType- The vertex type to use.layer- If cutout, the alpha discard threshold is 0.1, otherwise 0.- Returns:
- A compilation context.
-
getAlphaDiscard
Gets the alpha discard threshold for the given render layer.- Parameters:
layer- The render layer to get the alpha discard threshold for.- Returns:
- The alpha discard threshold.
-
equals
-
hashCode
public int hashCode() -
toString
-