manual background rendering for screens instead of using the tessellator since that seems to have caused crashes on certain graphics cards with certain drivers (see #31)

This commit is contained in:
Florian Nücke 2014-01-07 14:10:28 +01:00
parent e5277b9b41
commit 993e67a2e4

View File

@ -135,14 +135,17 @@ object MonospaceFontRenderer {
private val bgv2 = 256.0 / 256.0 private val bgv2 = 256.0 / 256.0
private def draw(color: Int, offset: Int, width: Int) = if (color != 0 && width > 0) { private def draw(color: Int, offset: Int, width: Int) = if (color != 0 && width > 0) {
val t = Tessellator.instance GL11.glBegin(GL11.GL_QUADS)
t.startDrawingQuads() GL11.glColor3ub(((color >> 16) & 0xFF).toByte, ((color >> 8) & 0xFF).toByte, (color & 0xFF).toByte)
t.setColorOpaque_I(color) GL11.glTexCoord2d(bgu1, bgv2)
t.addVertexWithUV(charWidth * offset, charHeight, 0, bgu1, bgv2) GL11.glVertex3d(charWidth * offset, charHeight, 0)
t.addVertexWithUV(charWidth * (offset + width), charHeight, 0, bgu2, bgv2) GL11.glTexCoord2d(bgu2, bgv2)
t.addVertexWithUV(charWidth * (offset + width), 0, 0, bgu2, bgv1) GL11.glVertex3d(charWidth * (offset + width), charHeight, 0)
t.addVertexWithUV(charWidth * offset, 0, 0, bgu1, bgv1) GL11.glTexCoord2d(bgu2, bgv1)
t.draw() GL11.glVertex3d(charWidth * (offset + width), 0, 0)
GL11.glTexCoord2d(bgu1, bgv1)
GL11.glVertex3d(charWidth * offset, 0, 0)
GL11.glEnd()
} }
private def flush() = if (listBuffer.position > 0) { private def flush() = if (listBuffer.position > 0) {