Example usage for org.lwjgl.opengl GL11 glScaled

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

Introduction

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

Prototype

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

Source Link

Document

Double version of #glScalef Scalef .

Usage

From source file:com.kodehawa.gui.api.components.ModuleGui.java

License:Open Source License

public void makeInfoFrame() {
    final Frame iFrame = new Frame(CheatBase.instance, 250, 30, 120, 20, 0xff550055, 0xaa000000,
            "Player Info") {
        @Override/*from w  w w .j  a v a  2  s.c  o  m*/
        public void update() {
            this.draw();
            String dim = "Overworld";
            String dir = "NORTH";
            int d = mc.thePlayer.dimension;

            if (d == -1) {
                dim = "Nether";
            }
            if (d == 0) {
                dim = "Overworld";
            }
            if (d == 1) {
                dim = "The End";
            }

            int var24 = MathHelper.floor_double(((mc.thePlayer.rotationYaw * 4.0F) / 360.0F) + 0.5D) & 3;
            dir = Direction.directions[var24];
            try {
                children.clear();
                //addChild( new Label( "User: " + CheatBase.instance.minecraft.thePlayer.username, 0xffffff ) );
                addChild(new Label("FPS: " + mc.debugFPS, 0xffffff));
                addChild(new Label("X: " + (int) CheatBase.instance.minecraft.thePlayer.posX, 0xffffff));
                addChild(new Label("Y: " + (int) CheatBase.instance.minecraft.thePlayer.posY, 0xffffff));
                addChild(new Label("Z: " + (int) CheatBase.instance.minecraft.thePlayer.posZ, 0xffffff));
                addChild(new Label("Dimension: " + dim, 0xffffff));
                //addChild( new Label( "Facing " + dir, 0xffffff ) );

                addChild(new Label("", 0xffffff));
            } catch (Exception e) {
                e.printStackTrace();
            }

        }

        @Override
        public void draw() {
            // TODO Auto-generated method stub

            if (color2 > -1) {
                ModGuiUtils.drawRect(x, y, x + width, y + oldHeight, color);
                ModGuiUtils.drawRect(x, y, x + width, y + oldHeight, (int) (color * 1.1));
            } else {
                ModGuiUtils.drawGradientRect(x, y, x + width, y + oldHeight, color, color2);
                ModGuiUtils.drawRect(x, y + oldHeight, x + width, y + height, color2);
            }

            /**
             * Minimize button
             */
            ModGuiUtils.drawFilledCircle((x + width) - 8, y + 7, 2.5, 0xff00dd66);
            if (minimized) {
                ModGuiUtils.drawFilledCircle((x + width) - 8, y + 7, 2.5, 0xaa000000);
            }

            if (pinnable) {
                ModGuiUtils.drawFilledCircle((x + width) - 16, y + 7, 2.5, 0xff72a9dc);
                if (pinned) {
                    ModGuiUtils.drawFilledCircle((x + width) - 16, y + 7, 2.5, 0xaa000000);
                }
            }

            ModGuiUtils.drawHorizontalLine(this.x + 2, (this.x + this.width) - 2, (this.y + this.oldHeight) - 6,
                    2, 0xff550055);

            CheatBase.instance.minecraft.fontRenderer.drawString(this.text, this.x + 3, this.y + 3, 0xff87b5ff);
            // TTFRenderer.drawTTFString( Colony.guiFont, this.text, x + 2,
            // y, 0x87b5ff );

            if (minimized) {
                this.height = oldHeight;
            } else {
                this.height = (int) (oldHeight + ((oldHeight * this.children.size()) / 1.4) + 5) / 2;
            }
            if (!minimized) {
                GL11.glPushMatrix();
                GL11.glScaled(0.5, 0.5, 0.5);
                for (Item e : children) {
                    e.x = ((this.x) + 3) * 2;
                    int offset = oldHeight;
                    offset /= 8;
                    offset += 4;
                    e.y = ((this.y) + (offset * (this.children.indexOf(e) + 1)) + 15) * 2;

                    e.update();

                }
                GL11.glScaled(1, 1, 1);
                GL11.glPopMatrix();
            }
        }
    };
    iFrame.setPinnable(false);
    addFrame(iFrame);
}

From source file:com.kodehawa.gui.api.components.ModuleGui.java

License:Open Source License

public void makeTestFrame() {
    Frame tFrame = new Frame(CheatBase.instance, 130, 30, 120, 20, 0xff550000, 0xaa000055, "Console") {
        @Override/*from  w  ww . j av a 2  s  .c  o m*/
        public void update() {
            this.draw();
            if (this.children.size() > 10) {
                this.removeLater(this.children.get(1));
            }
        }

        @Override
        public void draw() {
            // TODO Auto-generated method stub

            if (color2 > -1) {
                ModGuiUtils.drawRect(x, y, x + width, y + oldHeight, color);
                ModGuiUtils.drawRect(x, y, x + width, y + oldHeight, (int) (color * 1.1));
            } else {
                ModGuiUtils.drawGradientRect(x, y, x + width, y + oldHeight, color, color2);
                ModGuiUtils.drawRect(x, y + oldHeight, x + width, y + height, color2);
            }

            /**
             * Minimize button
             */
            ModGuiUtils.drawFilledCircle((x + width) - 8, y + 7, 2.5, 0xff00dd66);
            if (minimized) {
                ModGuiUtils.drawFilledCircle((x + width) - 8, y + 7, 2.5, 0xaa000000);
            }

            if (pinnable) {
                ModGuiUtils.drawFilledCircle((x + width) - 16, y + 7, 2.5, 0xff72a9dc);
                if (pinned) {
                    ModGuiUtils.drawFilledCircle((x + width) - 16, y + 7, 2.5, 0xaa000000);
                }
            }

            ModGuiUtils.drawHorizontalLine(this.x + 2, (this.x + this.width) - 2, (this.y + this.oldHeight) - 6,
                    2, 0xff550055);

            CheatBase.instance.minecraft.fontRenderer.drawString(this.text, this.x + 3, this.y + 3, 0xff87b5ff);

            // TTFRenderer.drawTTFString( Colony.guiFont, this.text, x + 2,
            // y,
            // 0x87b5ff );

            if (minimized) {
                this.height = oldHeight;

            } else {
                GL11.glPushMatrix();
                GL11.glScaled(0.5, 0.5, 0.5);
                CheatBase.instance.minecraft.fontRenderer.drawString("Type \'clear\' to clear history. ",
                        (this.x * 2) + 6, ((this.y + this.oldHeight) * 2) - 4, 0xffffff);
                GL11.glScaled(1, 1, 1);
                GL11.glPopMatrix();
                int diff = 0;
                if (this.children.size() > 0) {
                    diff = this.children.size() * 2;
                }
                this.height = (int) ((oldHeight + ((oldHeight * this.children.size()) / 1.4) + 5 + diff) / 1.1);
            }
            if (!minimized) {
                for (Item e : children) {
                    e.x = (this.x) + 3;
                    int offset = oldHeight;
                    offset /= 2;
                    offset += 4;
                    e.y = (this.y) + (offset * (this.children.indexOf(e) + 1)) + 10;
                    e.update();
                }
            }
        }
    };

    tFrame.addChild(new TextArea("", tFrame.x, tFrame.y + (tFrame.children.size() * 12), 100, 10, 0x77770077));

    addFrame(tFrame);
}

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

License:Open Source License

/**
 * Triangle. Used for radars//from  w ww. ja v  a  2  s  .  co  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.lunix.cheata.gui.CheataGui.java

License:Open Source License

/**
 * Draws the screen and all the components in it. Args : mouseX, mouseY,
 * renderPartialTicks//from   ww w  .  ja  va2s.com
 **/
public void drawScreen(int mouseX, int mouseY, float partialTicks) {

    /** Draws the tiled dirt **/
    this.drawDefaultBackground();

    /** Draws the Title **/
    this.drawCenteredString(this.fontRendererObj, this.mainText, this.width / 2, 20, Client.getColor());

    GL11.glPushMatrix();
    GL11.glScaled(4, 4, 4);
    this.drawCenteredString(this.fontRendererObj, "IDK WHAT TO", this.width / 8, this.height / 8 - 5,
            Client.getColor());
    this.drawCenteredString(this.fontRendererObj, "PUT HERE", this.width / 8, this.height / 8 + 5,
            Client.getColor());
    GL11.glPopMatrix();

    /** Strings for copyright **/
    /** Draws the copyright **/
    this.drawString(this.fontRendererObj, I18n.format("cheata.copyright.line1", new Object[0]), 2,
            this.height - 30, Client.getColor());
    this.drawString(this.fontRendererObj, I18n.format("cheata.copyright.line2", new Object[0]), 2,
            this.height - 20, Client.getColor());
    this.drawString(this.fontRendererObj, I18n.format("cheata.copyright.line3", new Object[0]), 2,
            this.height - 10, Client.getColor());

    /** String for body text **/
    String body1 = "";

    super.drawScreen(mouseX, mouseY, partialTicks);
}

From source file:com.lunix.cheata.gui.CheataMainMenu.java

License:Open Source License

/**
 * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
 *//*from w  w w.j  a v a 2  s. c  o m*/
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
    this.drawDefaultBackground();
    GL11.glPushMatrix();
    GL11.glScaled(7, 6, 5);
    String var1 = "Cheata";
    this.drawCenteredString(mc.fontRendererObj, var1, ((this.width / 7) / 2), ((this.height / 6) / 4) - 5,
            0xffb825);
    GL11.glPopMatrix();
    if (needsUpdate) {
        this.drawRect(0, 0, this.width, 20, Client.getColor());
        this.drawCenteredString(mc.fontRendererObj, "New version of Cheata found : " + updateVersion,
                this.width / 2, 6, Client.getColor());
    }
    super.drawScreen(mouseX, mouseY, partialTicks);
}

From source file:com.minestellar.core.render.item.AntennaItemRender.java

License:Open Source License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    switch (type) {
    case ENTITY://from w w w .ja v  a 2 s.  co m
        GL11.glPushMatrix();
        GL11.glTranslated(-0.5, 0, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityRadioAntenna(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0.5, 0, 0.5);
        GL11.glPopMatrix();
        break;
    case EQUIPPED_FIRST_PERSON:
        GL11.glPushMatrix();
        GL11.glScaled(0.45D, 0.45D, 0.45D);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityRadioAntenna(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glPopMatrix();
        break;
    case INVENTORY:
        GL11.glPushMatrix();
        GL11.glScaled(0.45D, 0.45D, 0.45D);
        GL11.glRotated(-180, 0, 10, 0);
        GL11.glTranslated(0, -0.65, 0);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityRadioAntenna(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0, +0.65, 0);
        GL11.glPopMatrix();
        break;
    }
}

From source file:com.minestellar.core.render.item.CableItemRender.java

License:Open Source License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    switch (type) {
    case EQUIPPED_FIRST_PERSON:
        GL11.glPushMatrix();/* w ww.ja  va  2 s .co  m*/
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityCable(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glPopMatrix();
        break;
    case INVENTORY:
        GL11.glPushMatrix();
        GL11.glScaled(2, 2, 2);
        GL11.glTranslated(0, -0.1255, 0);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityCable(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0, 0.1255, 0);
        GL11.glPopMatrix();
        break;
    case ENTITY:
        GL11.glPushMatrix();
        GL11.glScaled(2, 2, 2);
        GL11.glTranslated(-0.5, 0, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityCable(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0.5, 0, 0.5);
        GL11.glPopMatrix();
        break;
    default:
        break;
    }
}

From source file:com.minestellar.core.render.item.ComputerItemRender.java

License:Open Source License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    switch (type) {
    case ENTITY:/*from  w w w.jav  a2s.  c  om*/
        GL11.glPushMatrix();
        GL11.glScaled(2, 2, 0);
        GL11.glTranslated(-0.5, 0, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityComputer(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0.5, 0, 0.5);
        GL11.glPopMatrix();
        break;
    case EQUIPPED_FIRST_PERSON:
        GL11.glPushMatrix();
        GL11.glTranslated(0, 0.5, 0);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityComputer(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glPopMatrix();
        break;
    case INVENTORY:
        GL11.glPushMatrix();
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityComputer(), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glPopMatrix();
        break;
    }
}

From source file:com.minestellar.core.render.item.OxygenCollectorItemRender.java

License:Open Source License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    switch (type) {
    case EQUIPPED_FIRST_PERSON:
        GL11.glPushMatrix();/* w  w w  .  jav a2  s .  c  o m*/
        GL11.glTranslated(0, 0.25, 0);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityOxygenCollector(), 0.0D, 0.0D,
                0.0D, 0.0F);
        GL11.glTranslated(0, -0.25, 0);
        GL11.glPopMatrix();
        break;
    case INVENTORY:
        GL11.glPushMatrix();
        GL11.glScaled(1.5, 1.5, 1.5);
        GL11.glTranslated(0, -0.1255, 0);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityOxygenCollector(), 0.0D, 0.0D,
                0.0D, 0.0F);
        GL11.glTranslated(0, 0.1255, 0);
        GL11.glPopMatrix();
        break;
    case ENTITY:
        GL11.glPushMatrix();
        GL11.glTranslated(-0.5, 0, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityOxygenCollector(), 0.0D, 0.0D,
                0.0D, 0.0F);
        GL11.glTranslated(0.5, 0, 0.5);
        GL11.glPopMatrix();
    default:
        break;
    }
}

From source file:com.minestellar.core.render.item.PipeItemRender.java

License:Open Source License

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    switch (type) {
    case EQUIPPED_FIRST_PERSON:
        GL11.glPushMatrix();//w w w. j a  va  2  s  .c  om
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityPipe(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glPopMatrix();
        break;
    case INVENTORY:
        GL11.glPushMatrix();
        GL11.glScaled(2, 2, 2);
        GL11.glTranslated(0, -0.1255, 0);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityPipe(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0, 0.1255, 0);
        GL11.glPopMatrix();
        break;
    case ENTITY:
        GL11.glPushMatrix();
        GL11.glScaled(2, 2, 2);
        GL11.glTranslated(-0.5, 0, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityPipe(meta), 0.0D, 0.0D, 0.0D,
                0.0F);
        GL11.glTranslated(0.5, 0, 0.5);
        GL11.glPopMatrix();
        break;
    default:
        break;
    }
}