Example usage for org.lwjgl.opengl GL11 glVertex2d

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

Introduction

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

Prototype

public static native void glVertex2d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y);

Source Link

Document

Double version of #glVertex2f Vertex2f .

Usage

From source file:tk.wurst_client.alts.gui.GuiAltList.java

License:Open Source License

@Override
protected void drawSlot(int id, int x, int y, int var4, int var5, int var6) {
    Alt alt = alts.get(id);//from w  w w  .  j  av  a2 s  .  c om
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_CULL_FACE);
    GL11.glEnable(GL_BLEND);
    if (Minecraft.getMinecraft().getSession().getUsername().equals(alt.getName())) {
        float opacity = 0.3F - MathHelper.abs(
                MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * (float) Math.PI * 2.0F) * 0.15F);
        GL11.glColor4f(0.0F, 1.0F, 0.0F, opacity);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(x - 2, y - 2);
            GL11.glVertex2d(x - 2 + 250, y - 2);
            GL11.glVertex2d(x - 2 + 250, y - 2 + 30);
            GL11.glVertex2d(x - 2, y - 2 + 30);
        }
        GL11.glEnd();
    }
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_CULL_FACE);
    GL11.glDisable(GL_BLEND);
    AltRenderer.drawAltFace(alt.getName(), x + 1, y + 1, 24, 24,
            GuiAlts.altList.isSelected(GuiAltList.alts.indexOf(alt)));
    mc.fontRendererObj.drawString("Name: " + alt.getName(), x + 31, y + 3, 10526880);
    mc.fontRendererObj.drawString(
            (alt.isCracked() ? "8cracked" : "2premium") + (alt.isStarred() ? "r & estarred" : ""), x + 31,
            y + 15, 10526880);
}

From source file:tk.wurst_client.alts.gui.GuiAlts.java

License:Open Source License

/**
 * Draws the screen and all the components in it.
 *///from ww  w. jav a  2s . c om
@Override
public void drawScreen(int par1, int par2, float par3) {
    drawDefaultBackground();
    altList.drawScreen(par1, par2, par3);
    if (altList.getSelectedSlot() != -1 && altList.getSelectedSlot() < GuiAltList.alts.size()) {
        Alt alt = GuiAltList.alts.get(altList.getSelectedSlot());
        AltRenderer.drawAltBack(alt.getName(), (width / 2 - 125) / 2 - 32, height / 2 - 64 - 9, 64, 128);
        AltRenderer.drawAltBody(alt.getName(), width - (width / 2 - 140) / 2 - 32, height / 2 - 64 - 9, 64,
                128);
    }
    drawCenteredString(fontRendererObj, "Alt Manager", width / 2, 4, 16777215);
    drawCenteredString(fontRendererObj, "Alts: " + GuiAltList.alts.size(), width / 2, 14, 10526880);
    drawCenteredString(fontRendererObj,
            "premium: " + GuiAltList.premiumAlts + ", cracked: " + GuiAltList.crackedAlts, width / 2, 24,
            10526880);
    if (errorTimer > 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL_CULL_FACE);
        GL11.glEnable(GL_BLEND);
        GL11.glColor4f(1.0F, 0.0F, 0.0F, (float) errorTimer / 16);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(0, 0);
            GL11.glVertex2d(width, 0);
            GL11.glVertex2d(width, height);
            GL11.glVertex2d(0, height);
        }
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL_CULL_FACE);
        GL11.glDisable(GL_BLEND);
        errorTimer--;
    }
    super.drawScreen(par1, par2, par3);
}

From source file:tk.wurst_client.alts.GuiAltAdd.java

License:Open Source License

/**
 * Draws the screen and all the components in it.
 *//* ww w. j  a v  a 2 s  . c  om*/
@Override
public void drawScreen(int par1, int par2, float par3) {
    drawDefaultBackground();
    AltUtils.drawAltBack(nameBox.getText(), (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
    AltUtils.drawAltBody(nameBox.getText(), width - (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
    drawCenteredString(fontRendererObj, "Add an Alt", width / 2, 20, 16777215);
    drawString(fontRendererObj, "Name or E-Mail", width / 2 - 100, 47, 10526880);
    drawString(fontRendererObj, "Password", width / 2 - 100, 87, 10526880);
    drawCenteredString(fontRendererObj, displayText, width / 2, 142, 16777215);
    nameBox.drawTextBox();
    passwordBox.drawTextBox();
    if (errorTimer > 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL_CULL_FACE);
        GL11.glEnable(GL_BLEND);
        GL11.glColor4f(1.0F, 0.0F, 0.0F, (float) errorTimer / 16);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(0, 0);
            GL11.glVertex2d(width, 0);
            GL11.glVertex2d(width, height);
            GL11.glVertex2d(0, height);
        }
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL_CULL_FACE);
        GL11.glDisable(GL_BLEND);
        errorTimer--;
    }
    super.drawScreen(par1, par2, par3);
}

From source file:tk.wurst_client.alts.GuiAltEdit.java

License:Open Source License

/**
 * Draws the screen and all the components in it.
 *///from w  ww .  jav  a 2s.  c om
@Override
public void drawScreen(int par1, int par2, float par3) {
    drawDefaultBackground();
    AltUtils.drawAltBack(nameBox.getText(), (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
    AltUtils.drawAltBody(nameBox.getText(), width - (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
    drawCenteredString(fontRendererObj, "Edit this Alt", width / 2, 20, 16777215);
    drawString(fontRendererObj, "Name or E-Mail", width / 2 - 100, 47, 10526880);
    drawString(fontRendererObj, "Password", width / 2 - 100, 87, 10526880);
    drawCenteredString(fontRendererObj, displayText, width / 2, 142, 16777215);
    nameBox.drawTextBox();
    passwordBox.drawTextBox();
    if (errorTimer > 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL_CULL_FACE);
        GL11.glEnable(GL_BLEND);
        GL11.glColor4f(1.0F, 0.0F, 0.0F, (float) errorTimer / 16);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(0, 0);
            GL11.glVertex2d(width, 0);
            GL11.glVertex2d(width, height);
            GL11.glVertex2d(0, height);
        }
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL_CULL_FACE);
        GL11.glDisable(GL_BLEND);
        errorTimer--;
    }
    super.drawScreen(par1, par2, par3);
}

From source file:tk.wurst_client.alts.GuiAltList.java

License:Open Source License

@Override
protected void drawSlot(int id, int x, int y, int var4, int var5, int var6) {
    Alt alt = alts.get(id);//from   www . j  av  a 2s . c  om
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_CULL_FACE);
    GL11.glEnable(GL_BLEND);
    if (Minecraft.getMinecraft().getSession().getUsername().equals(alt.name)) {
        float opacity = 0.3F - MathHelper.abs(
                MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * (float) Math.PI * 2.0F) * 0.15F);
        GL11.glColor4f(0.0F, 1.0F, 0.0F, opacity);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(x - 2, y - 2);
            GL11.glVertex2d(x - 2 + 250, y - 2);
            GL11.glVertex2d(x - 2 + 250, y - 2 + 30);
            GL11.glVertex2d(x - 2, y - 2 + 30);
        }
        GL11.glEnd();
    }
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_CULL_FACE);
    GL11.glDisable(GL_BLEND);
    AltUtils.drawAltFace(alt.name, x + 1, y + 1, 24, 24,
            GuiAlts.altList.isSelected(GuiAltList.alts.indexOf(alt)));
    mc.fontRendererObj.drawString("Name: " + alt.name, x + 31, y + 3, 10526880);
    String stars = "";
    for (int i = 0; i < alt.password.length(); i++)
        stars = stars.concat("*");
    mc.fontRendererObj.drawString(alt.cracked ? "cracked" : "Password: " + stars, x + 31, y + 15, 10526880);
}

From source file:tk.wurst_client.alts.GuiAltLogin.java

License:Open Source License

/**
 * Draws the screen and all the components in it.
 *///w w  w  .  ja va 2s .  c om
@Override
public void drawScreen(int par1, int par2, float par3) {
    drawDefaultBackground();
    AltUtils.drawAltBack(nameBox.getText(), (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
    AltUtils.drawAltBody(nameBox.getText(), width - (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
    drawCenteredString(fontRendererObj, "Login", width / 2, 20, 16777215);
    drawString(fontRendererObj, "Name or E-Mail", width / 2 - 100, 47, 10526880);
    drawString(fontRendererObj, "Password", width / 2 - 100, 87, 10526880);
    drawCenteredString(fontRendererObj, displayText, width / 2, 142, 16777215);
    nameBox.drawTextBox();
    passwordBox.drawTextBox();
    if (errorTimer > 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL_CULL_FACE);
        GL11.glEnable(GL_BLEND);
        GL11.glColor4f(1.0F, 0.0F, 0.0F, (float) errorTimer / 16);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(0, 0);
            GL11.glVertex2d(width, 0);
            GL11.glVertex2d(width, height);
            GL11.glVertex2d(0, height);
        }
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL_CULL_FACE);
        GL11.glDisable(GL_BLEND);
        errorTimer--;
    }
    super.drawScreen(par1, par2, par3);
}

From source file:tk.wurst_client.alts.GuiAlts.java

License:Open Source License

/**
 * Draws the screen and all the components in it.
 */// w ww .jav  a  2s  .co m
@Override
public void drawScreen(int par1, int par2, float par3) {
    drawDefaultBackground();
    altList.drawScreen(par1, par2, par3);
    if (altList.getSelectedSlot() != -1) {
        Alt alt = GuiAltList.alts.get(altList.getSelectedSlot());
        AltUtils.drawAltBack(alt.name, (width / 2 - 125) / 2 - 32, height / 2 - 64 - 9, 64, 128);
        AltUtils.drawAltBody(alt.name, width - (width / 2 - 140) / 2 - 32, height / 2 - 64 - 9, 64, 128);
    }
    drawCenteredString(fontRendererObj, "Alt Manager", width / 2, 8, 16777215);
    drawCenteredString(fontRendererObj, "Alts: " + GuiAltList.alts.size(), width / 2, 20, 16777215);
    if (errorTimer > 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL_CULL_FACE);
        GL11.glEnable(GL_BLEND);
        GL11.glColor4f(1.0F, 0.0F, 0.0F, (float) errorTimer / 16);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(0, 0);
            GL11.glVertex2d(width, 0);
            GL11.glVertex2d(width, height);
            GL11.glVertex2d(0, height);
        }
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL_CULL_FACE);
        GL11.glDisable(GL_BLEND);
        errorTimer--;
    }
    super.drawScreen(par1, par2, par3);
}

From source file:tk.wurst_client.features.mods.TemplateToolMod.java

License:Open Source License

@Override
public void onRenderGUI() {
    // GL settings
    GL11.glEnable(GL11.GL_BLEND);/*w  w w.  ja  va 2 s  . c  o  m*/
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_CULL_FACE);

    GL11.glPushMatrix();

    String message;
    if (step.selectPos && step.pos != null)
        message = "Press enter to confirm, or select a different position.";
    else if (step == Step.FILE_NAME && file != null && file.exists())
        message = "WARNING: This file already exists.";
    else
        message = step.message;

    // translate to center
    ScaledResolution sr = new ScaledResolution(mc);
    int msgWidth = Fonts.segoe15.getStringWidth(message);
    GL11.glTranslated(sr.getScaledWidth() / 2 - msgWidth / 2, sr.getScaledHeight() / 2 + 1, 0);

    // background
    GL11.glColor4f(0, 0, 0, 0.5F);
    GL11.glBegin(GL11.GL_QUADS);
    {
        GL11.glVertex2d(0, 0);
        GL11.glVertex2d(msgWidth + 2, 0);
        GL11.glVertex2d(msgWidth + 2, 10);
        GL11.glVertex2d(0, 10);
    }
    GL11.glEnd();

    // text
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    Fonts.segoe15.drawString(message, 2, -1, 0xffffffff);

    GL11.glPopMatrix();

    // GL resets
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
}

From source file:tk.wurst_client.gui.alts.AltEditorScreen.java

License:Open Source License

/**
 * Draws the screen and all the components in it.
 *//*from ww w  .ja va 2 s.co m*/
@Override
public void drawScreen(int par1, int par2, float par3) {
    drawDefaultBackground();
    AltRenderer.drawAltBack(emailBox.getText(), (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
    AltRenderer.drawAltBody(emailBox.getText(), width - (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);
    drawCenteredString(fontRendererObj, getTitle(), width / 2, 20, 16777215);
    drawString(fontRendererObj, "Name or E-Mail", width / 2 - 100, 47, 10526880);
    drawString(fontRendererObj, "Password", width / 2 - 100, 87, 10526880);
    drawCenteredString(fontRendererObj, displayText, width / 2, 142, 16777215);
    emailBox.drawTextBox();
    passwordBox.drawTextBox();
    if (errorTimer > 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL_CULL_FACE);
        GL11.glEnable(GL_BLEND);
        GL11.glColor4f(1.0F, 0.0F, 0.0F, (float) errorTimer / 16);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(0, 0);
            GL11.glVertex2d(width, 0);
            GL11.glVertex2d(width, height);
            GL11.glVertex2d(0, height);
        }
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL_CULL_FACE);
        GL11.glDisable(GL_BLEND);
        errorTimer--;
    }
    super.drawScreen(par1, par2, par3);
}

From source file:tk.wurst_client.gui.alts.GuiAltList.java

License:Open Source License

@Override
protected void drawSlot(int id, int x, int y, int var4, int var5, int var6) {
    Alt alt = alts.get(id);//from   ww  w.j  a v  a 2s.  c  o m
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_CULL_FACE);
    GL11.glEnable(GL_BLEND);
    if (Minecraft.getMinecraft().getSession().getUsername().equals(alt.getName())) {
        float opacity = 0.3F - MathHelper.abs(
                MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * (float) Math.PI * 2.0F) * 0.15F);
        GL11.glColor4f(0.0F, 1.0F, 0.0F, opacity);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(x - 2, y - 2);
            GL11.glVertex2d(x - 2 + 220, y - 2);
            GL11.glVertex2d(x - 2 + 220, y - 2 + 30);
            GL11.glVertex2d(x - 2, y - 2 + 30);
        }
        GL11.glEnd();
    }
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_CULL_FACE);
    GL11.glDisable(GL_BLEND);
    AltRenderer.drawAltFace(alt.getNameOrEmail(), x + 1, y + 1, 24, 24,
            GuiAlts.altList.isSelected(GuiAltList.alts.indexOf(alt)));
    mc.fontRendererObj.drawString("Name: " + alt.getNameOrEmail(), x + 31, y + 3, 10526880);

    String tags = alt.isCracked() ? "8cracked" : "2premium";
    if (alt.isStarred())
        tags += "r, estarred";
    if (alt.isUnchecked())
        tags += "r, cunchecked";
    mc.fontRendererObj.drawString(tags, x + 31, y + 15, 10526880);
}