#Support carnavious
1 messages · Page 1 of 1 (latest)
fun drawRect(left: Double, top: Double, right: Double, bottom: Double, color: Int) {
var leftModifiable = left
var topModifiable = top
var rightModifiable = right
var bottomModifiable = bottom
if (leftModifiable < rightModifiable) {
val i = leftModifiable
leftModifiable = rightModifiable
rightModifiable = i
}
if (topModifiable < bottomModifiable) {
val j = topModifiable
topModifiable = bottomModifiable
bottomModifiable = j
}
val f3 = (color shr 24 and 255).toFloat() / 255.0f
val f = (color shr 16 and 255).toFloat() / 255.0f
val f1 = (color shr 8 and 255).toFloat() / 255.0f
val f2 = (color and 255).toFloat() / 255.0f
GlStateManager.color(f, f1, f2, f3)
val tessellator = Tessellator.getInstance()
val worldRenderer = tessellator.worldRenderer
GlStateManager.enableBlend()
GlStateManager.disableTexture2D()
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
worldRenderer.begin(7, DefaultVertexFormats.POSITION)
worldRenderer.pos(leftModifiable, bottomModifiable, 0.0).endVertex()
worldRenderer.pos(rightModifiable, bottomModifiable, 0.0).endVertex()
worldRenderer.pos(rightModifiable, topModifiable, 0.0).endVertex()
worldRenderer.pos(leftModifiable, topModifiable, 0.0).endVertex()
tessellator.draw()
GlStateManager.enableTexture2D()
GlStateManager.disableBlend()
}```
well, i foudn this. https://greyminecraftcoder.blogspot.com/2014/12/the-tessellator-and-worldrenderer-18.html
why is finding documentation so pepega
holy shit something is working