Example usage for org.lwjgl.opengl GL11 glColor4f

List of usage examples for org.lwjgl.opengl GL11 glColor4f

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glColor4f.

Prototype

public static native void glColor4f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green,
        @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha);

Source Link

Document

Float version of #glColor4b Color4b

Usage

From source file:com.xlogisticzz.learningModding.client.interfaces.gui.GuiMachine.java

License:LGPL

@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
    GL11.glColor4f(1, 1, 1, 1);
    Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
    drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);

    int meta = entityMachine.worldObj.getBlockMetadata(entityMachine.xCoord, entityMachine.yCoord,
            entityMachine.zCoord);//from  w w  w  . j a v  a2  s . c  o m
    int type = meta / 2;

    if (type != 0) {
        int srcX = 20 * (type - 1);
        int srcY = ySize;

        drawTexturedModalRect(guiLeft + 16, guiTop + 42, srcX, srcY, 20, 20);
    }

    float filled = entityMachine.getGravel() / 192F;
    int barHeight = (int) (filled * 27);
    if (barHeight > 0) {
        int srcX = xSize;
        int srcY = 27 - barHeight;

        drawTexturedModalRect(guiLeft + 157, guiTop + 40 + 27 - barHeight, srcX, srcY, 7, barHeight);
    }

    if (type == 4) {
        for (int i = 0; i < rectangles.length; i++) {
            GuiRectangle rect = rectangles[i];
            int srcX = xSize;

            if (rect.inRect(this, x, y)) {
                srcX += 8;
            }

            rect.draw(this, srcX, 27);

            if (entityMachine.customSetup[i]) {
                rect.draw(this, xSize, 35);
            }
        }

    }

    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    drawTexturedModelRectFromIcon(guiLeft + 63, guiTop + 17, ModBlocks.machineblock.getIcon(1, meta), 16, 16);
}

From source file:com.xlogisticzz.learningModding.client.interfaces.gui.GuiSpaceship.java

License:LGPL

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {

    GL11.glColor4f(1, 1, 1, 1);
    Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
    drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}

From source file:com.yogpc.qp.client.GuiMover.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(gui);
    drawTexturedModalRect(this.width - this.xSize >> 1, this.height - this.ySize >> 1, 0, 0, this.xSize,
            this.ySize);
}

From source file:com.yogpc.qp.client.GuiPlacer.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(tex);
    final int k = (this.width - this.xSize) / 2;
    final int l = (this.height - this.ySize) / 2;
    drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}

From source file:com.yogpc.qp.client.RenderRefinery.java

License:Open Source License

private static int[] getFluidDisplayLists(final FluidStack fluidStack) {
    final Fluid fluid = fluidStack.getFluid();
    if (fluid == null)
        return null;
    final Map<Fluid, int[]> cache = stillRenderCache;
    int[] diplayLists = cache.get(fluid);
    if (diplayLists != null)
        return diplayLists;
    diplayLists = new int[100];
    Block baseBlock;/*from   ww  w. jav  a  2  s  . c  o  m*/
    IIcon texture;
    if (fluid.getBlock() != null) {
        baseBlock = fluid.getBlock();
        texture = fluid.getStillIcon();
    } else {
        baseBlock = Blocks.water;
        texture = fluid.getStillIcon();
    }
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_CULL_FACE);
    for (int s = 0; s < 100; ++s) {
        diplayLists[s] = GLAllocation.generateDisplayLists(1);
        GL11.glNewList(diplayLists[s], GL11.GL_COMPILE);
        final Tessellator tessellator = Tessellator.instance;
        tessellator.startDrawingQuads();
        renderBlocks.setRenderBounds(0.01, 0, 0.01, 0.99, (float) s / 100, 0.99);
        renderBlocks.renderFaceYNeg(baseBlock, 0, 0, 0,
                texture != null ? texture : baseBlock.getBlockTextureFromSide(0));
        renderBlocks.renderFaceYPos(baseBlock, 0, 0, 0,
                texture != null ? texture : baseBlock.getBlockTextureFromSide(1));
        renderBlocks.renderFaceZNeg(baseBlock, 0, 0, 0,
                texture != null ? texture : baseBlock.getBlockTextureFromSide(2));
        renderBlocks.renderFaceZPos(baseBlock, 0, 0, 0,
                texture != null ? texture : baseBlock.getBlockTextureFromSide(3));
        renderBlocks.renderFaceXNeg(baseBlock, 0, 0, 0,
                texture != null ? texture : baseBlock.getBlockTextureFromSide(4));
        renderBlocks.renderFaceXPos(baseBlock, 0, 0, 0,
                texture != null ? texture : baseBlock.getBlockTextureFromSide(5));
        tessellator.draw();
        GL11.glEndList();
    }
    GL11.glColor4f(1, 1, 1, 1);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_LIGHTING);
    cache.put(fluid, diplayLists);
    return diplayLists;
}

From source file:cpw.mods.compactsolars.client.GUISolar.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    //    mc.renderEngine.func_110577_a(gui);
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    drawTexturedModalRect(l, i1, 0, 0, xSize, ySize);
    if (container.tile.theSunIsVisible) {
        drawTexturedModalRect(l + 80, i1 + 45, 176, 0, 14, 14);
    }/* w  ww. jav  a  2 s .c  o  m*/
}

From source file:cpw.mods.fml.client.config.GuiUtils.java

License:Open Source License

/**
 * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders
 * and filler. It is assumed that the desired texture ResourceLocation object has been bound using
 * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
 * //from   w  ww  .  jav a  2 s  .co  m
 * @param x x axis offset
 * @param y y axis offset
 * @param u bound resource location image x offset
 * @param v bound resource location image y offset
 * @param width the desired box width
 * @param height the desired box height
 * @param textureWidth the width of the box texture in the resource location image
 * @param textureHeight the height of the box texture in the resource location image
 * @param topBorder the size of the box's top border
 * @param bottomBorder the size of the box's bottom border
 * @param leftBorder the size of the box's left border
 * @param rightBorder the size of the box's right border
 * @param zLevel the zLevel to draw at
 */
public static void drawContinuousTexturedBox(int x, int y, int u, int v, int width, int height,
        int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder,
        float zLevel) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    int fillerWidth = textureWidth - leftBorder - rightBorder;
    int fillerHeight = textureHeight - topBorder - bottomBorder;
    int canvasWidth = width - leftBorder - rightBorder;
    int canvasHeight = height - topBorder - bottomBorder;
    int xPasses = canvasWidth / fillerWidth;
    int remainderWidth = canvasWidth % fillerWidth;
    int yPasses = canvasHeight / fillerHeight;
    int remainderHeight = canvasHeight % fillerHeight;

    // Draw Border
    // Top Left
    drawTexturedModalRect(x, y, u, v, leftBorder, topBorder, zLevel);
    // Top Right
    drawTexturedModalRect(x + leftBorder + canvasWidth, y, u + leftBorder + fillerWidth, v, rightBorder,
            topBorder, zLevel);
    // Bottom Left
    drawTexturedModalRect(x, y + topBorder + canvasHeight, u, v + topBorder + fillerHeight, leftBorder,
            bottomBorder, zLevel);
    // Bottom Right
    drawTexturedModalRect(x + leftBorder + canvasWidth, y + topBorder + canvasHeight,
            u + leftBorder + fillerWidth, v + topBorder + fillerHeight, rightBorder, bottomBorder, zLevel);

    for (int i = 0; i < xPasses + (remainderWidth > 0 ? 1 : 0); i++) {
        // Top Border
        drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y, u + leftBorder, v,
                (i == xPasses ? remainderWidth : fillerWidth), topBorder, zLevel);
        // Bottom Border
        drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y + topBorder + canvasHeight, u + leftBorder,
                v + topBorder + fillerHeight, (i == xPasses ? remainderWidth : fillerWidth), bottomBorder,
                zLevel);

        // Throw in some filler for good measure
        for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++)
            drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y + topBorder + (j * fillerHeight),
                    u + leftBorder, v + topBorder, (i == xPasses ? remainderWidth : fillerWidth),
                    (j == yPasses ? remainderHeight : fillerHeight), zLevel);
    }

    // Side Borders
    for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++) {
        // Left Border
        drawTexturedModalRect(x, y + topBorder + (j * fillerHeight), u, v + topBorder, leftBorder,
                (j == yPasses ? remainderHeight : fillerHeight), zLevel);
        // Right Border
        drawTexturedModalRect(x + leftBorder + canvasWidth, y + topBorder + (j * fillerHeight),
                u + leftBorder + fillerWidth, v + topBorder, rightBorder,
                (j == yPasses ? remainderHeight : fillerHeight), zLevel);
    }
}

From source file:cpw.mods.fml.client.GuiModList.java

License:Open Source License

@Override
public void drawScreen(int p_571_1_, int p_571_2_, float p_571_3_) {
    this.modList.drawScreen(p_571_1_, p_571_2_, p_571_3_);
    this.drawCenteredString(this.fontRendererObj, "Mod List", this.width / 2, 16, 0xFFFFFF);
    int offset = this.listWidth + 20;
    if (selectedMod != null) {
        GL11.glEnable(GL11.GL_BLEND);/* w w w .j a  va 2s  . c  om*/
        if (!selectedMod.getMetadata().autogenerated) {
            configModButton.visible = true;
            disableModButton.visible = true;
            disableModButton.packedFGColour = 0xFF3377;
            configModButton.enabled = false;
            int shifty = 35;
            String logoFile = selectedMod.getMetadata().logoFile;
            if (!logoFile.isEmpty()) {
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                TextureManager tm = mc.getTextureManager();
                IResourcePack pack = FMLClientHandler.instance().getResourcePackFor(selectedMod.getModId());
                try {
                    if (cachedLogo == null) {
                        BufferedImage logo = null;
                        if (pack != null) {
                            logo = pack.getPackImage();
                        } else {
                            InputStream logoResource = getClass().getResourceAsStream(logoFile);
                            if (logoResource != null) {
                                logo = ImageIO.read(logoResource);
                            }
                        }
                        if (logo != null) {
                            cachedLogo = tm.getDynamicTextureLocation("modlogo", new DynamicTexture(logo));
                            cachedLogoDimensions = new Dimension(logo.getWidth(), logo.getHeight());
                        }
                    }
                    if (cachedLogo != null) {
                        this.mc.renderEngine.bindTexture(cachedLogo);
                        double scaleX = cachedLogoDimensions.width / 200.0;
                        double scaleY = cachedLogoDimensions.height / 65.0;
                        double scale = 1.0;
                        if (scaleX > 1 || scaleY > 1) {
                            scale = 1.0 / Math.max(scaleX, scaleY);
                        }
                        cachedLogoDimensions.width *= scale;
                        cachedLogoDimensions.height *= scale;
                        int top = 32;
                        Tessellator tess = Tessellator.instance;
                        tess.startDrawingQuads();
                        tess.addVertexWithUV(offset, top + cachedLogoDimensions.height, zLevel, 0, 1);
                        tess.addVertexWithUV(offset + cachedLogoDimensions.width,
                                top + cachedLogoDimensions.height, zLevel, 1, 1);
                        tess.addVertexWithUV(offset + cachedLogoDimensions.width, top, zLevel, 1, 0);
                        tess.addVertexWithUV(offset, top, zLevel, 0, 0);
                        tess.draw();

                        shifty += 65;
                    }
                } catch (IOException e) {
                    ;
                }
            }
            this.fontRendererObj.drawStringWithShadow(selectedMod.getMetadata().name, offset, shifty, 0xFFFFFF);
            shifty += 12;

            shifty = drawLine(String.format("Version: %s (%s)", selectedMod.getDisplayVersion(),
                    selectedMod.getVersion()), offset, shifty);
            shifty = drawLine(String.format("Mod ID: '%s' Mod State: %s", selectedMod.getModId(),
                    Loader.instance().getModState(selectedMod)), offset, shifty);
            if (!selectedMod.getMetadata().credits.isEmpty()) {
                shifty = drawLine(String.format("Credits: %s", selectedMod.getMetadata().credits), offset,
                        shifty);
            }
            shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset,
                    shifty);
            shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty);
            shifty = drawLine(
                    selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod"
                            : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()),
                    offset, shifty);
            int rightSide = this.width - offset - 20;
            if (rightSide > 20) {
                this.getFontRenderer().drawSplitString(selectedMod.getMetadata().description, offset,
                        shifty + 10, rightSide, 0xDDDDDD);
            }
            Disableable disableable = selectedMod.canBeDisabled();
            if (disableable == Disableable.RESTART) {
                disableModButton.enabled = true;
                disableModButton.visible = true;
                disableModButton.packedFGColour = 0xFF3377;
            } else if (disableable == Disableable.YES) {
                disableModButton.enabled = true;
                disableModButton.visible = true;
                disableModButton.packedFGColour = 0;
            } else {
                disableModButton.packedFGColour = 0;
                disableModButton.visible = true;
                disableModButton.enabled = false;
            }
            IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod);
            if (guiFactory == null || guiFactory.mainConfigGuiClass() == null) {
                configModButton.visible = true;
                configModButton.enabled = false;
            } else {
                configModButton.visible = true;
                configModButton.enabled = true;
            }
        } else {
            offset = (this.listWidth + this.width) / 2;
            this.drawCenteredString(this.fontRendererObj, selectedMod.getName(), offset, 35, 0xFFFFFF);
            this.drawCenteredString(this.fontRendererObj,
                    String.format("Version: %s", selectedMod.getVersion()), offset, 45, 0xFFFFFF);
            this.drawCenteredString(this.fontRendererObj,
                    String.format("Mod State: %s", Loader.instance().getModState(selectedMod)), offset, 55,
                    0xFFFFFF);
            this.drawCenteredString(this.fontRendererObj, "No mod information found", offset, 65, 0xDDDDDD);
            this.drawCenteredString(this.fontRendererObj,
                    "Ask your mod author to provide a mod mcmod.info file", offset, 75, 0xDDDDDD);
            configModButton.visible = false;
            disableModButton.visible = false;
        }
        GL11.glDisable(GL11.GL_BLEND);
    } else {
        configModButton.visible = false;
        disableModButton.visible = false;
    }
    super.drawScreen(p_571_1_, p_571_2_, p_571_3_);
}

From source file:cpw.mods.fml.client.GuiScrollingList.java

License:Open Source License

public void drawScreen(int mouseX, int mouseY, float p_22243_3_) {
    this.mouseX = mouseX;
    this.mouseY = mouseY;
    this.drawBackground();
    int listLength = this.getSize();
    int scrollBarXStart = this.left + this.listWidth - 6;
    int scrollBarXEnd = scrollBarXStart + 6;
    int boxLeft = this.left;
    int boxRight = scrollBarXStart - 1;
    int var10;
    int var11;
    int var13;
    int var19;

    if (Mouse.isButtonDown(0)) {
        if (this.initialMouseClickY == -1.0F) {
            boolean var7 = true;

            if (mouseY >= this.top && mouseY <= this.bottom) {
                var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4;
                var11 = var10 / this.slotHeight;

                if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) {
                    boolean var12 = var11 == this.selectedIndex
                            && System.currentTimeMillis() - this.lastClickTime < 250L;
                    this.elementClicked(var11, var12);
                    this.selectedIndex = var11;
                    this.lastClickTime = System.currentTimeMillis();
                } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) {
                    this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4);
                    var7 = false;
                }//www  .  j a  va2  s  . co m

                if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) {
                    this.scrollFactor = -1.0F;
                    var19 = this.getContentHeight() - (this.bottom - this.top - 4);

                    if (var19 < 1) {
                        var19 = 1;
                    }

                    var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top))
                            / (float) this.getContentHeight());

                    if (var13 < 32) {
                        var13 = 32;
                    }

                    if (var13 > this.bottom - this.top - 8) {
                        var13 = this.bottom - this.top - 8;
                    }

                    this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19;
                } else {
                    this.scrollFactor = 1.0F;
                }

                if (var7) {
                    this.initialMouseClickY = (float) mouseY;
                } else {
                    this.initialMouseClickY = -2.0F;
                }
            } else {
                this.initialMouseClickY = -2.0F;
            }
        } else if (this.initialMouseClickY >= 0.0F) {
            this.scrollDistance -= ((float) mouseY - this.initialMouseClickY) * this.scrollFactor;
            this.initialMouseClickY = (float) mouseY;
        }
    } else {
        while (Mouse.next()) {
            int var16 = Mouse.getEventDWheel();

            if (var16 != 0) {
                if (var16 > 0) {
                    var16 = -1;
                } else if (var16 < 0) {
                    var16 = 1;
                }

                this.scrollDistance += (float) (var16 * this.slotHeight / 2);
            }
        }

        this.initialMouseClickY = -1.0F;
    }

    this.applyScrollLimits();
    Tessellator var18 = Tessellator.instance;
    if (this.client.theWorld != null) {
        this.drawGradientRect(this.left, this.top, this.right, this.bottom, -1072689136, -804253680);
    } else {
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_FOG);
        this.client.renderEngine.bindTexture(Gui.optionsBackground);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        float var17 = 32.0F;
        var18.startDrawingQuads();
        var18.setColorOpaque_I(2105376);
        var18.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D,
                (double) ((float) this.left / var17),
                (double) ((float) (this.bottom + (int) this.scrollDistance) / var17));
        var18.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D,
                (double) ((float) this.right / var17),
                (double) ((float) (this.bottom + (int) this.scrollDistance) / var17));
        var18.addVertexWithUV((double) this.right, (double) this.top, 0.0D,
                (double) ((float) this.right / var17),
                (double) ((float) (this.top + (int) this.scrollDistance) / var17));
        var18.addVertexWithUV((double) this.left, (double) this.top, 0.0D, (double) ((float) this.left / var17),
                (double) ((float) (this.top + (int) this.scrollDistance) / var17));
        var18.draw();
    }
    //        boxRight = this.listWidth / 2 - 92 - 16;
    var10 = this.top + 4 - (int) this.scrollDistance;

    if (this.field_27262_q) {
        this.func_27260_a(boxRight, var10, var18);
    }

    int var14;

    for (var11 = 0; var11 < listLength; ++var11) {
        var19 = var10 + var11 * this.slotHeight + this.field_27261_r;
        var13 = this.slotHeight - 4;

        if (var19 <= this.bottom && var19 + var13 >= this.top) {
            if (this.field_25123_p && this.isSelected(var11)) {
                var14 = boxLeft;
                int var15 = boxRight;
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glDisable(GL11.GL_TEXTURE_2D);
                var18.startDrawingQuads();
                var18.setColorOpaque_I(8421504);
                var18.addVertexWithUV((double) var14, (double) (var19 + var13 + 2), 0.0D, 0.0D, 1.0D);
                var18.addVertexWithUV((double) var15, (double) (var19 + var13 + 2), 0.0D, 1.0D, 1.0D);
                var18.addVertexWithUV((double) var15, (double) (var19 - 2), 0.0D, 1.0D, 0.0D);
                var18.addVertexWithUV((double) var14, (double) (var19 - 2), 0.0D, 0.0D, 0.0D);
                var18.setColorOpaque_I(0);
                var18.addVertexWithUV((double) (var14 + 1), (double) (var19 + var13 + 1), 0.0D, 0.0D, 1.0D);
                var18.addVertexWithUV((double) (var15 - 1), (double) (var19 + var13 + 1), 0.0D, 1.0D, 1.0D);
                var18.addVertexWithUV((double) (var15 - 1), (double) (var19 - 1), 0.0D, 1.0D, 0.0D);
                var18.addVertexWithUV((double) (var14 + 1), (double) (var19 - 1), 0.0D, 0.0D, 0.0D);
                var18.draw();
                GL11.glEnable(GL11.GL_TEXTURE_2D);
            }

            this.drawSlot(var11, boxRight, var19, var13, var18);
        }
    }

    GL11.glDisable(GL11.GL_DEPTH_TEST);
    byte var20 = 4;
    if (this.client.theWorld == null) {
        this.overlayBackground(0, this.top, 255, 255);
        this.overlayBackground(this.bottom, this.listHeight, 255, 255);
    }
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glShadeModel(GL11.GL_SMOOTH);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    var18.startDrawingQuads();
    var18.setColorRGBA_I(0, 0);
    var18.addVertexWithUV((double) this.left, (double) (this.top + var20), 0.0D, 0.0D, 1.0D);
    var18.addVertexWithUV((double) this.right, (double) (this.top + var20), 0.0D, 1.0D, 1.0D);
    var18.setColorRGBA_I(0, 255);
    var18.addVertexWithUV((double) this.right, (double) this.top, 0.0D, 1.0D, 0.0D);
    var18.addVertexWithUV((double) this.left, (double) this.top, 0.0D, 0.0D, 0.0D);
    var18.draw();
    var18.startDrawingQuads();
    var18.setColorRGBA_I(0, 255);
    var18.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D, 0.0D, 1.0D);
    var18.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D, 1.0D, 1.0D);
    var18.setColorRGBA_I(0, 0);
    var18.addVertexWithUV((double) this.right, (double) (this.bottom - var20), 0.0D, 1.0D, 0.0D);
    var18.addVertexWithUV((double) this.left, (double) (this.bottom - var20), 0.0D, 0.0D, 0.0D);
    var18.draw();
    var19 = this.getContentHeight() - (this.bottom - this.top - 4);

    if (var19 > 0) {
        var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight();

        if (var13 < 32) {
            var13 = 32;
        }

        if (var13 > this.bottom - this.top - 8) {
            var13 = this.bottom - this.top - 8;
        }

        var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top;

        if (var14 < this.top) {
            var14 = this.top;
        }

        var18.startDrawingQuads();
        var18.setColorRGBA_I(0, 255);
        var18.addVertexWithUV((double) scrollBarXStart, (double) this.bottom, 0.0D, 0.0D, 1.0D);
        var18.addVertexWithUV((double) scrollBarXEnd, (double) this.bottom, 0.0D, 1.0D, 1.0D);
        var18.addVertexWithUV((double) scrollBarXEnd, (double) this.top, 0.0D, 1.0D, 0.0D);
        var18.addVertexWithUV((double) scrollBarXStart, (double) this.top, 0.0D, 0.0D, 0.0D);
        var18.draw();
        var18.startDrawingQuads();
        var18.setColorRGBA_I(8421504, 255);
        var18.addVertexWithUV((double) scrollBarXStart, (double) (var14 + var13), 0.0D, 0.0D, 1.0D);
        var18.addVertexWithUV((double) scrollBarXEnd, (double) (var14 + var13), 0.0D, 1.0D, 1.0D);
        var18.addVertexWithUV((double) scrollBarXEnd, (double) var14, 0.0D, 1.0D, 0.0D);
        var18.addVertexWithUV((double) scrollBarXStart, (double) var14, 0.0D, 0.0D, 0.0D);
        var18.draw();
        var18.startDrawingQuads();
        var18.setColorRGBA_I(12632256, 255);
        var18.addVertexWithUV((double) scrollBarXStart, (double) (var14 + var13 - 1), 0.0D, 0.0D, 1.0D);
        var18.addVertexWithUV((double) (scrollBarXEnd - 1), (double) (var14 + var13 - 1), 0.0D, 1.0D, 1.0D);
        var18.addVertexWithUV((double) (scrollBarXEnd - 1), (double) var14, 0.0D, 1.0D, 0.0D);
        var18.addVertexWithUV((double) scrollBarXStart, (double) var14, 0.0D, 0.0D, 0.0D);
        var18.draw();
    }

    this.func_27257_b(mouseX, mouseY);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glShadeModel(GL11.GL_FLAT);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glDisable(GL11.GL_BLEND);
}