mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 10:21:45 -04:00
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:
parent
e5277b9b41
commit
993e67a2e4
@ -135,14 +135,17 @@ object MonospaceFontRenderer {
|
||||
private val bgv2 = 256.0 / 256.0
|
||||
|
||||
private def draw(color: Int, offset: Int, width: Int) = if (color != 0 && width > 0) {
|
||||
val t = Tessellator.instance
|
||||
t.startDrawingQuads()
|
||||
t.setColorOpaque_I(color)
|
||||
t.addVertexWithUV(charWidth * offset, charHeight, 0, bgu1, bgv2)
|
||||
t.addVertexWithUV(charWidth * (offset + width), charHeight, 0, bgu2, bgv2)
|
||||
t.addVertexWithUV(charWidth * (offset + width), 0, 0, bgu2, bgv1)
|
||||
t.addVertexWithUV(charWidth * offset, 0, 0, bgu1, bgv1)
|
||||
t.draw()
|
||||
GL11.glBegin(GL11.GL_QUADS)
|
||||
GL11.glColor3ub(((color >> 16) & 0xFF).toByte, ((color >> 8) & 0xFF).toByte, (color & 0xFF).toByte)
|
||||
GL11.glTexCoord2d(bgu1, bgv2)
|
||||
GL11.glVertex3d(charWidth * offset, charHeight, 0)
|
||||
GL11.glTexCoord2d(bgu2, bgv2)
|
||||
GL11.glVertex3d(charWidth * (offset + width), charHeight, 0)
|
||||
GL11.glTexCoord2d(bgu2, bgv1)
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user