Example usage for org.lwjgl.opengl GL11 glBlendFunc

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

Introduction

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

Prototype

public static void glBlendFunc(@NativeType("GLenum") int sfactor, @NativeType("GLenum") int dfactor) 

Source Link

Document

Specifies the weighting factors used by the blend equation, for both RGB and alpha functions and for all draw buffers.

Usage

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

/**
 * Quad drawn with Tessellator.java/*  www.  ja  v  a  2  s  . c o m*/
 * 
 * @param i
 * @param j
 * @param k
 * @param l
 * @param i1
 */
public static void dr(double i, double j, double k, double l, int i1) {
    if (i < k) {
        double j1 = i;
        i = k;
        k = j1;
    }
    if (j < l) {
        double k1 = j;
        j = l;
        l = k1;
    }
    float f = ((i1 >> 24) & 0xff) / 255F;
    float f1 = ((i1 >> 16) & 0xff) / 255F;
    float f2 = ((i1 >> 8) & 0xff) / 255F;
    float f3 = (i1 & 0xff) / 255F;
    Tessellator tessellator = Tessellator.instance;
    GL11.glEnable(3042);
    GL11.glDisable(3553);
    GL11.glBlendFunc(770, 771);
    GL11.glColor4f(f1, f2, f3, f);
    tessellator.startDrawingQuads();
    tessellator.addVertex(i, l, 0.0D);
    tessellator.addVertex(k, l, 0.0D);
    tessellator.addVertex(k, j, 0.0D);
    tessellator.addVertex(i, j, 0.0D);
    tessellator.draw();
    GL11.glEnable(3553);
    GL11.glDisable(3042);
}

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

/**
 * Border of a circle//from  w w  w  .j  av a  2  s  . c om
 * 
 * @param x
 * @param y
 * @param r
 * @param c
 */
public static void drawCircle(int x, int y, double r, int c) {
    float f = ((c >> 24) & 0xff) / 255F;
    float f1 = ((c >> 16) & 0xff) / 255F;
    float f2 = ((c >> 8) & 0xff) / 255F;
    float f3 = (c & 0xff) / 255F;
    GL11.glEnable(3042 /* GL_BLEND */);
    GL11.glDisable(3553 /* GL_TEXTURE_2D */);
    GL11.glEnable(2848 /* GL_LINE_SMOOTH */);
    GL11.glBlendFunc(770, 771);
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glBegin(2 /* GL_LINE_LOOP */);
    for (int i = 0; i <= 360; i++) {
        double x2 = Math.sin(((i * 3.141526D) / 180)) * r;
        double y2 = Math.cos(((i * 3.141526D) / 180)) * r;
        GL11.glVertex2d(x + x2, y + y2);
    }
    GL11.glEnd();
    GL11.glDisable(2848 /* GL_LINE_SMOOTH */);
    GL11.glEnable(3553 /* GL_TEXTURE_2D */);
    GL11.glDisable(3042 /* GL_BLEND */);
}

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

/**
 * Circle/*w w  w  .  j a  va  2 s.  co m*/
 * 
 * @param x
 * @param y
 * @param r
 * @param c
 */
public static void drawFilledCircle(int x, int y, double r, int c) {
    float f = ((c >> 24) & 0xff) / 255F;
    float f1 = ((c >> 16) & 0xff) / 255F;
    float f2 = ((c >> 8) & 0xff) / 255F;
    float f3 = (c & 0xff) / 255F;
    GL11.glEnable(3042 /* GL_BLEND */);
    GL11.glDisable(3553 /* GL_TEXTURE_2D */);
    GL11.glEnable(2848 /* GL_LINE_SMOOTH */);
    GL11.glBlendFunc(770, 771);
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glBegin(6 /* GL_TRIANGLE_FAN */);
    for (int i = 0; i <= 360; i++) {
        double x2 = Math.sin(((i * 3.141526D) / 180)) * r;
        double y2 = Math.cos(((i * 3.141526D) / 180)) * r;
        GL11.glVertex2d(x + x2, y + y2);
    }
    GL11.glEnd();
    GL11.glDisable(2848 /* GL_LINE_SMOOTH */);
    GL11.glEnable(3553 /* GL_TEXTURE_2D */);
    GL11.glDisable(3042 /* GL_BLEND */);
}

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

/**
 * Triangle//from w  w w  .j  a v a 2 s  .c o  m
 * 
 * @param cx
 * @param cy
 * @param c
 */
public static void drawTri(int cx, int cy, int c) {
    GL11.glRotatef(180, 0F, 0F, 1.0F);
    float f = ((c >> 24) & 0xff) / 255F;
    float f1 = ((c >> 16) & 0xff) / 255F;
    float f2 = ((c >> 8) & 0xff) / 255F;
    float f3 = (c & 0xff) / 255F;
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glEnable(3042);
    GL11.glDisable(3553);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);
    GL11.glBlendFunc(770, 771);
    GL11.glBegin(GL11.GL_TRIANGLES);
    GL11.glRotatef(180, 0F, 0F, 1.0F);
    GL11.glVertex2d(cx, cy + 2);
    GL11.glVertex2d(cx + 2, cy - 2);
    GL11.glVertex2d(cx - 2, cy - 2);

    GL11.glEnd();
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GL11.glEnable(3553);
    GL11.glDisable(3042);
    GL11.glRotatef(-180, 0F, 0F, 1.0F);
}

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

/**
 * Triangle. Used for radars/*from  ww  w  . ja  v a 2  s  .  c  o  m*/
 * 
 * @param e
 * @param cx
 * @param cy
 * @param c
 */
public static void drawTriangle(Entity e, double cx, double cy, int c) {
    GL11.glPushMatrix();
    GL11.glScaled(0.5, 0.5, 0.5);
    GL11.glTranslated(cx, cy, 0);
    if (e instanceof EntityClientPlayerMP) {
        GL11.glRotatef(e.rotationYaw, 0F, 0F, 1.0F);
    } else {
        GL11.glRotatef(-e.rotationYaw, 0F, 0F, 1.0F);
    }
    float f = ((c >> 24) & 0xff) / 255F;
    float f1 = ((c >> 16) & 0xff) / 255F;
    float f2 = ((c >> 8) & 0xff) / 255F;
    float f3 = (c & 0xff) / 255F;
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glEnable(3042);
    GL11.glDisable(3553);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);
    GL11.glBlendFunc(770, 771);
    GL11.glBegin(GL11.GL_TRIANGLES);

    GL11.glVertex2d(0, 0 + 6);
    GL11.glVertex2d(0 + 3, 0 - 2);
    GL11.glVertex2d(0 - 3, 0 - 2);

    GL11.glEnd();
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GL11.glEnable(3553);
    GL11.glDisable(3042);
    GL11.glRotatef(e.rotationYaw, 0F, 0F, 1.0F);

    GL11.glPopMatrix();
}

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

/**
 * Half Circle/*ww  w  . j a  va  2s  .  c  o  m*/
 * 
 * Modes: 0 Left to right, bottom to top 1 Top to bottom, left to right 2
 * Right to left, top to bottom 3 Bottom to top, right to left
 * 
 * @param x
 * @param y
 * @param r
 * @param c
 */
public static void drawFilledHalfCircle(int x, int y, double r, int c, int mode) {
    float f = ((c >> 24) & 0xff) / 255F;
    float f1 = ((c >> 16) & 0xff) / 255F;
    float f2 = ((c >> 8) & 0xff) / 255F;
    float f3 = (c & 0xff) / 255F;
    GL11.glDisable(3553 /* GL_TEXTURE_2D */);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(770, 771);

    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    GL11.glEnable(GL11.GL_LINE_SMOOTH);
    GL11.glEnable(GL11.GL_POLYGON_SMOOTH);
    GL11.glEnable(GL11.GL_POINT_SMOOTH);
    GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST);
    GL11.glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_NICEST);
    GL11.glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_NICEST);

    GL11.glColor4f(f1, f2, f3, f);
    GL11.glBegin(6 /* GL_TRIANGLE_FAN */);

    int startang = 0;
    int endang = 0;

    if (mode == 0) {
        startang = 90;
        endang = 270;
    }
    if (mode == 1) {
        startang = 360;
        endang = 540;
    }
    if (mode == 2) {
        startang = 270;
        endang = 450;
    }
    if (mode == 3) {
        startang = 180;
        endang = 360;
    }

    for (int i = startang; i <= endang; i++) {
        double x2 = Math.sin(((i * 3.141526D) / 180)) * r;
        double y2 = Math.cos(((i * 3.141526D) / 180)) * r;
        GL11.glVertex2d(x + x2, y + y2);
    }
    GL11.glEnd();
    GL11.glDisable(GL11.GL_POLYGON_SMOOTH);
    GL11.glDisable(GL11.GL_POINT_SMOOTH);
    GL11.glDisable(2848 /* GL_LINE_SMOOTH */);
    GL11.glEnable(3553 /* GL_TEXTURE_2D */);
    GL11.glDisable(3042 /* GL_BLEND */);
}

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

public static void drawGradientRect(double x, double y, double x2, double y2, int col1, int col2) {
    float f = ((col1 >> 24) & 0xFF) / 255F;
    float f1 = ((col1 >> 16) & 0xFF) / 255F;
    float f2 = ((col1 >> 8) & 0xFF) / 255F;
    float f3 = (col1 & 0xFF) / 255F;

    float f4 = ((col2 >> 24) & 0xFF) / 255F;
    float f5 = ((col2 >> 16) & 0xFF) / 255F;
    float f6 = ((col2 >> 8) & 0xFF) / 255F;
    float f7 = (col2 & 0xFF) / 255F;

    GL11.glEnable(GL11.GL_BLEND);/*from  w  w w  .jav  a  2  s.c o  m*/
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);
    GL11.glShadeModel(GL11.GL_SMOOTH);

    GL11.glPushMatrix();
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glVertex2d(x2, y);
    GL11.glVertex2d(x, y);

    GL11.glColor4f(f5, f6, f7, f4);
    GL11.glVertex2d(x, y2);
    GL11.glVertex2d(x2, y2);
    GL11.glEnd();
    GL11.glPopMatrix();

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GL11.glShadeModel(GL11.GL_FLAT);
}

From source file:com.kodehawa.gui.api.render.ModGuiUtils.java

License:Open Source License

public static void drawGBRect(double x, double y, double x2, double y2, float l1, int col1, int col2,
        int col3) {
    float f = ((col1 >> 24) & 0xFF) / 255F;
    float f1 = ((col1 >> 16) & 0xFF) / 255F;
    float f2 = ((col1 >> 8) & 0xFF) / 255F;
    float f3 = (col1 & 0xFF) / 255F;

    GL11.glDisable(GL11.GL_TEXTURE_2D);/*  w w  w.  ja v  a2s  . c o  m*/
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);
    GL11.glDisable(GL11.GL_BLEND);

    GL11.glPushMatrix();
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glLineWidth(1F);
    GL11.glBegin(GL11.GL_LINES);
    GL11.glVertex2d(x, y);
    GL11.glVertex2d(x, y2);
    GL11.glVertex2d(x2, y2);
    GL11.glVertex2d(x2, y);
    GL11.glVertex2d(x, y);
    GL11.glVertex2d(x2, y);
    GL11.glVertex2d(x, y2);
    GL11.glVertex2d(x2, y2);
    GL11.glEnd();
    GL11.glPopMatrix();

    drawGradientRect(x, y, x2, y2, col2, col3);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
}

From source file:com.Magic.MagicMod.gui.utils.ScrollingBase.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;
                }//from  w w w . j ava  2 s  .c  o  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
    {
        //   System.out.print("10000");
        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;
        //System.out.print("  var19 "+var19+" \n var13 "+var13+" \n bottom "+this.bottom+" \n top "+this.top);
        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);
            }
            //System.out.print("var19 "+var19+" /n var13 "+var13+"   1  ");
            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);
}

From source file:com.minestellar.core.gui.ComputerGui.java

License:Open Source License

@Override
public void drawForeground() {
    GL11.glDisable(GL11.GL_LIGHTING);/*from w  ww.  jav  a  2s. c  o  m*/
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    {
        GL11.glPushMatrix();
        {
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_DEPTH_TEST);
            GL11.glDepthMask(false);
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            GL11.glDisable(GL11.GL_TEXTURE_2D);

            // Earth
            GL11.glColor4d(0, 0, 1, 1);
            Tessellator tess = Tessellator.instance;
            tess.startDrawing(GL11.GL_LINES);

            for (Point2D.Double anEarthCoordsArray : earthCoordsArray) {
                tess.addVertex(getMid(screenWidth) + 4 + anEarthCoordsArray.x,
                        getMid(screenHeight) + 4 + anEarthCoordsArray.y, 0.0D);
            }

            tess.draw();

            if (knownPlanets.contains("moon")) {
                GL11.glColor4d(0.89, 0.89, 0.89, 1);
                tess.startDrawing(GL11.GL_LINES);

                for (Point2D.Double aMoonCoordsArray : moonCoordsArray) {
                    tess.addVertex(earth.x + 4 + aMoonCoordsArray.x, earth.y + 4 + aMoonCoordsArray.y, 0.0D);
                }

                tess.draw();
            }

            if (knownPlanets.contains("venus")) {
                GL11.glColor4d(0.84, 0.63, 0.29, 1);
                tess.startDrawing(GL11.GL_LINES);

                for (Point2D.Double aVenusCoordsArray : venusCoordsArray) {
                    tess.addVertex(getMid(screenWidth) + 4 + aVenusCoordsArray.x,
                            getMid(screenHeight) + 4 + aVenusCoordsArray.y, 0.0D);
                }

                tess.draw();
            }

        }

        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_DEPTH_TEST);
        GL11.glDepthMask(true);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
    GL11.glPopMatrix();

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
}