Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal class ManagedGlState(
var polygonOffset: Boolean,
var polygonOffsetFactor: Float,
var polygonOffsetUnits: Float,
var shadeModel: Int,
var alphaTest: Boolean,
var alphaTestFunc: Int,
var alphaTestRef: Float,
Expand All @@ -40,6 +41,7 @@ internal class ManagedGlState(
polygonOffset = other.polygonOffset,
polygonOffsetFactor = other.polygonOffsetFactor,
polygonOffsetUnits = other.polygonOffsetUnits,
shadeModel = other.shadeModel,
alphaTest = other.alphaTest,
alphaTestFunc = other.alphaTestFunc,
alphaTestRef = other.alphaTestRef,
Expand Down Expand Up @@ -160,6 +162,10 @@ internal class ManagedGlState(
//#if MC>=11700
//$$ @Suppress("UNUSED_VARIABLE") val unused = org
//#else
if (curr.shadeModel != shadeModel) {
curr.shadeModel = shadeModel
GlStateManager.shadeModel(shadeModel)
}
if (curr.alphaTest != alphaTest) {
curr.alphaTest = alphaTest
//#if MC==11602
Expand Down Expand Up @@ -212,10 +218,12 @@ internal class ManagedGlState(
polygonOffsetFactor = GL11.glGetFloat(GL11.GL_POLYGON_OFFSET_FACTOR),
polygonOffsetUnits = GL11.glGetFloat(GL11.GL_POLYGON_OFFSET_UNITS),
//#if MC>=11700
//$$ shadeModel = 0,
//$$ alphaTest = false,
//$$ alphaTestFunc = 0,
//$$ alphaTestRef = 0f,
//#else
shadeModel = GL11.glGetInteger(GL11.GL_SHADE_MODEL),
alphaTest = GL11.glGetBoolean(GL11.GL_ALPHA_TEST),
alphaTestFunc = GL11.glGetInteger(GL11.GL_ALPHA_TEST_FUNC),
alphaTestRef = GL11.glGetFloat(GL11.GL_ALPHA_TEST_REF),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ class URenderPipeline private constructor(
polygonOffset = polygonOffset.first != 0f || polygonOffset.second != 0f,
polygonOffsetFactor = polygonOffset.first,
polygonOffsetUnits = polygonOffset.second,
shadeModel = GL11.GL_SMOOTH,
alphaTest = true,
alphaTestFunc = GL11.GL_ALWAYS,
alphaTestRef = 0f,
Expand Down