protected void drawContainerBackground(@Nonnull BufferBuilder renderer) { Vector3f col = ColorUtil.toFloat(2105376); GlStateManager.color(col.x, col.y, col.z, 1.0F); GlStateManager.disableTexture2D(); renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); renderer.pos(minX, maxY + margin + 10, 0.0D).endVertex(); renderer.pos(maxX, maxY + margin + 10, 0.0D).endVertex(); renderer.pos(maxX, minY, 0.0D).endVertex(); renderer.pos(minX, minY, 0.0D).endVertex(); Tessellator.getInstance().draw(); GlStateManager.enableTexture2D(); }
public static void renderQuad2D(double x, double y, double z, double width, double height, int colorRGB) { GlStateManager.disableTexture2D(); Vector3f col = ColorUtil.toFloat(colorRGB); GlStateManager.color(col.x, col.y, col.z); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder tes = tessellator.getBuffer(); tes.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); tes.pos(x, y + height, z).endVertex(); tes.pos(x + width, y + height, z).endVertex(); tes.pos(x + width, y, z).endVertex(); tes.pos(x, y, z).endVertex(); tessellator.draw(); GlStateManager.enableTexture2D(); }
@Override public void drawButton(@Nonnull Minecraft mc, int mouseX, int mouseY, float partialTicks) { super.drawButton(mc, mouseX, mouseY, partialTicks); if (visible) { BufferBuilder tes = Tessellator.getInstance().getBuffer(); tes.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); int xAdj = this.x + 2; int yAdj = this.y + 2; GlStateManager.disableTexture2D(); int col = ItemDye.DYE_COLORS[colorIndex]; Vector3f c = ColorUtil.toFloat(col); GlStateManager.color(c.x, c.y, c.z); tes.pos(xAdj, yAdj + height - 4, zLevel).color(c.x, c.y, c.z, 1).endVertex(); tes.pos(xAdj + width - 4, yAdj + height - 4, zLevel).color(c.x, c.y, c.z, 1).endVertex(); tes.pos(xAdj + width - 4, yAdj + 0, zLevel).color(c.x, c.y, c.z, 1).endVertex(); tes.pos(xAdj, yAdj + 0, zLevel).color(c.x, c.y, c.z, 1).endVertex(); Tessellator.getInstance().draw(); GlStateManager.enableTexture2D(); } } }