Example usage for org.lwjgl.opengl GL11 glDisable

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

Introduction

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

Prototype

public static void glDisable(@NativeType("GLenum") int target) 

Source Link

Document

Disables the specified OpenGL state.

Usage

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

License:Open Source License

@Override
public void drawForeground() {
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_DEPTH_TEST);/*from www  . j  a  va2s .c o  m*/
    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);
}

From source file:com.minestellar.moon.world.SkyRendererMoon.java

License:Open Source License

@Override
public void render(float partialTicks, WorldClient world, Minecraft mc) {
    WorldProviderMoon gcProvider = null;

    if (world.provider instanceof WorldProviderMoon) {
        gcProvider = (WorldProviderMoon) world.provider;
    }//  w ww.  j a v a  2s .c om

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor3f(1, 1, 1);
    final Tessellator var23 = Tessellator.instance;
    GL11.glDepthMask(false);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glColor3f(0, 0, 0);
    GL11.glCallList(this.glSkyList);
    GL11.glDisable(GL11.GL_FOG);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderHelper.disableStandardItemLighting();
    float var10;
    float var11;
    float var12;

    float var20 = 0;

    if (gcProvider != null) {
        var20 = gcProvider.getStarBrightness(partialTicks);
    }

    if (var20 > 0.0F) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, var20);
        GL11.glCallList(this.starGLCallList);
    }

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
    GL11.glPushMatrix();

    GL11.glPopMatrix();

    GL11.glPushMatrix();

    // SUN:
    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 5F);
    GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
    var12 = 30.0F;
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(SkyRendererMoon.sunTexture);
    var23.startDrawingQuads();
    var23.addVertexWithUV(-var12, 150.0D, -var12, 0.0D, 0.0D);
    var23.addVertexWithUV(var12, 150.0D, -var12, 1.0D, 0.0D);
    var23.addVertexWithUV(var12, 150.0D, var12, 1.0D, 1.0D);
    var23.addVertexWithUV(-var12, 150.0D, var12, 0.0D, 1.0D);
    var23.draw();

    GL11.glPopMatrix();

    GL11.glPushMatrix();

    GL11.glDisable(GL11.GL_BLEND);

    // EARTH:
    var12 = 50.0F;
    final float earthRotation = (float) (world.getSpawnPoint().posZ - mc.thePlayer.posZ) * 0.01F;
    GL11.glScalef(0.6F, 0.6F, 0.6F);
    GL11.glRotatef(earthRotation, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(SkyRendererMoon.earthTexture);
    world.getMoonPhase();
    var23.startDrawingQuads();
    var23.addVertexWithUV(-var12, -400.0D, var12, 0, 1);
    var23.addVertexWithUV(var12, -400.0D, var12, 1, 1);
    var23.addVertexWithUV(var12, -400.0D, -var12, 1, 0);
    var23.addVertexWithUV(-var12, -400.0D, -var12, 0, 0);
    var23.draw();

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glPopMatrix();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor3f(0.0F, 0.0F, 0.0F);
    final double var25 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon();

    if (var25 < 0.0D) {
        GL11.glPushMatrix();
        GL11.glTranslatef(0.0F, 12.0F, 0.0F);
        GL11.glCallList(this.glSkyList2);
        GL11.glPopMatrix();
        var10 = 1.0F;
        var11 = -((float) (var25 + 65.0D));
        var12 = -var10;
        var23.startDrawingQuads();
        var23.setColorRGBA_I(0, 255);
        var23.addVertex(-var10, var11, var10);
        var23.addVertex(var10, var11, var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(var10, var12, -var10);
        var23.addVertex(var10, var11, -var10);
        var23.addVertex(-var10, var11, -var10);
        var23.addVertex(var10, var12, -var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(var10, var11, var10);
        var23.addVertex(var10, var11, -var10);
        var23.addVertex(-var10, var11, -var10);
        var23.addVertex(-var10, var11, var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(var10, var12, -var10);
        var23.draw();
    }

    GL11.glColor3f(70F / 256F, 70F / 256F, 70F / 256F);

    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, -((float) (var25 - 16.0D)), 0.0F);
    GL11.glCallList(this.glSkyList2);
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(true);
}

From source file:com.mrcrayfish.furniture.gui.GuiComputer.java

License:Open Source License

protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    this.fontRendererObj.drawString("Inventory", 8, (ySize - 103), 4210752);

    GL11.glPushMatrix();/*from  www  . j a  va2  s . c  o m*/
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_COLOR_MATERIAL);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    itemRender.zLevel = 100.0F;

    if ((itemNum - 1) >= 0) {
        ItemStack pre = itemdata[itemNum - 1].getInput();
        itemRender.renderItemAndEffectIntoGUI(pre, 57, 16);
        itemRender.renderItemOverlays(this.fontRendererObj, pre, 57, 16);
    }

    ItemStack stock = itemdata[itemNum].getInput();
    itemRender.renderItemAndEffectIntoGUI(stock, 80, 16);
    itemRender.renderItemOverlays(this.fontRendererObj, stock, 80, 16);

    if ((itemNum + 1) < itemdata.length) {
        ItemStack post = itemdata[itemNum + 1].getInput();
        itemRender.renderItemAndEffectIntoGUI(post, 103, 16);
        itemRender.renderItemOverlays(this.fontRendererObj, post, 103, 16);
    }

    ItemStack currency = itemdata[itemNum].getCurrency();
    itemRender.renderItemAndEffectIntoGUI(currency, 73, 40);
    itemRender.renderItemOverlays(this.fontRendererObj, currency, 73, 40);
    itemRender.zLevel = 0.0F;
    GL11.glDisable(GL11.GL_LIGHTING);

    int price = itemdata[itemNum].getPrice();
    this.fontRendererObj.drawString("x" + Integer.toString(price), 90, 44, 0);

    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    RenderHelper.enableStandardItemLighting();
}

From source file:com.mrcrayfish.furniture.gui.GuiDishwasher.java

License:Open Source License

public void drawColour(int x, int y, int width, int height, int par4) {
    WorldRenderer renderer = Tessellator.getInstance().getWorldRenderer();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    renderer.startDrawingQuads();/* w  ww. j  a  va  2  s .c  o  m*/
    renderer.setColorOpaque_I(par4);
    renderer.addVertex(x, y, 0.0D);
    renderer.addVertex(x, y + height, 0.0D);
    renderer.addVertex(x + width, y + height, 0.0D);
    renderer.addVertex(x + width, y, 0.0D);
    Tessellator.getInstance().draw();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}

From source file:com.mrcrayfish.furniture.gui.GuiRecipeBook.java

License:Open Source License

public void drawPlainArrow(int x, int y) {
    GL11.glPushMatrix();//from  ww w  .j a  v a 2s.co m
    GL11.glEnable(GL11.GL_BLEND);
    this.mc.getTextureManager().bindTexture(page_1);
    this.drawTexturedModalRect(x, y, 36, 180, 22, 15);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:com.mrcrayfish.furniture.gui.GuiRecipeBook.java

License:Open Source License

public void drawProgressArrow(int x, int y) {
    GL11.glPushMatrix();/*from  w  w  w . ja  v a  2s . co  m*/
    GL11.glEnable(GL11.GL_BLEND);
    this.mc.getTextureManager().bindTexture(page_1);
    this.drawTexturedModalRect(x, y, 36, 180, 22, 15);
    int percent = progress * 22 / 160;
    this.drawTexturedModalRect(x, y, 58, 180, percent + 1, 16);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:com.mrcrayfish.furniture.gui.GuiRecipeBook.java

License:Open Source License

public void drawTag(int x, int y) {
    GL11.glPushMatrix();/*from   ww w .  ja v a2 s .c  om*/
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_CULL_FACE);
    this.mc.getTextureManager().bindTexture(page_1);
    this.drawTexturedModalRect(x, y, 0, 200, 45, 18);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:com.mrcrayfish.furniture.gui.GuiRecipeBook.java

License:Open Source License

public void drawKnife(int x, int y) {
    GL11.glPushMatrix();/*  w w w  .  j a  v a2s. c  o  m*/
    GL11.glEnable(GL11.GL_BLEND);
    int percent = progress * 16 / 160;
    if (percent >= 12)
        percent = 12;
    getItemRenderer().renderItemAndEffectIntoGUI(knife, x, y + percent);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:com.mrcrayfish.furniture.gui.RecipePage.java

License:Open Source License

public void drawPage(Minecraft mc, GuiRecipeBook gui, int x, int y, int mouseX, int mouseY) {
    GL11.glPushMatrix();/*  w  w  w.ja v  a 2s.  c  o  m*/
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_COLOR_MATERIAL);
    GL11.glEnable(GL11.GL_LIGHTING);

    drawTitle(gui, x, y);
    drawDesc(gui, x, y);

    for (int i = 0; i < recipes.size(); i++) {
        if (type.equals("oven")) {
            this.drawOven(mc, gui, recipes.get(i), x + ((i / 4) * 150) + 15, y + (i % 4 * spacing));
            gui.drawProgressArrow(x + ((i / 4) * 150) + 42, y + (i % 4 * spacing) + 2);
        }
        if (type.equals("freezer")) {
            this.drawOven(mc, gui, recipes.get(i), x + ((i / 4) * 150) + 15, y + (i % 4 * spacing));
            gui.drawProgressArrow(x + ((i / 4) * 150) + 42, y + (i % 4 * spacing) + 2);
        }
        if (type.equals("minebay")) {
            this.drawMineBay(mc, gui, recipes.get(i), x + ((i / 4) * 150), y + (i % 4 * spacing));
        }
        if (type.equals("printer")) {
            this.drawPrinter(mc, gui, recipes.get(i), x + ((i % 5) * 20) + ((i / 20) * 145) + 7,
                    y + ((i / 5) * 20) - ((i / 20) * (4 * 20)) + 30);
        }
        if (type.equals("choppingboard")) {
            this.drawChoppingBoard(mc, gui, recipes.get(i), x + ((i / 4) * 150) + 15, y + (i % 4 * spacing));
            gui.drawPlainArrow(x + ((i / 4) * 150) + 42, y + (i % 4 * spacing) + 2);
        }
        if (type.equals("toaster")) {
            this.drawOven(mc, gui, recipes.get(i), x + ((i / 4) * 150) + 15, y + (i % 4 * spacing));
            gui.drawProgressArrow(x + ((i / 4) * 150) + 42, y + (i % 4 * spacing) + 2);
        }
        if (type.equals("blender")) {
            this.drawBlender(mc, gui, recipes.get(i), x + ((i / 2) * 150) + 8, y + (i % 2 * 50) + 10);
        }
        if (type.equals("washingmachine")) {
            this.drawPrinter(mc, gui, recipes.get(i), x + ((i % 5) * 20) + ((i / 20) * 145) + 7,
                    y + ((i / 5) * 20) - ((i / 20) * (4 * 20)) + 30);
        }
        if (type.equals("dishwasher")) {
            this.drawPrinter(mc, gui, recipes.get(i), x + ((i % 5) * 20) + ((i / 20) * 145) + 7,
                    y + ((i / 5) * 20) - ((i / 20) * (4 * 20)) + 30);
        }
        if (type.equals("microwave")) {
            this.drawOven(mc, gui, recipes.get(i), x + ((i / 4) * 150) + 15, y + (i % 4 * spacing));
            gui.drawProgressArrow(x + ((i / 4) * 150) + 42, y + (i % 4 * spacing) + 2);
        }
    }

    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    RenderHelper.enableStandardItemLighting();

    for (int i = 0; i < recipes.size(); i++) {
        if (type.equals("oven")) {
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 15, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getInput());
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 75, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getOutput());
        }
        if (type.equals("freezer")) {
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 15, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getInput());
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 75, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getOutput());
        }
        if (type.equals("minebay")) {
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 20, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getInput());
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 51, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getCurrency());
        }
        if (type.equals("printer")) {
            drawToolTip(gui, mc, x + ((i % 5) * 20) + ((i / 20) * 145) + 7,
                    y + ((i / 5) * 20) - ((i / 20) * (4 * 20)) + 30, mouseX, mouseY, recipes.get(i).getInput());
        }
        if (type.equals("choppingboard")) {
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 15, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getInput());
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 75, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getOutput());
        }
        if (type.equals("toaster")) {
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 15, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getInput());
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 75, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getOutput());
        }
        if (type.equals("blender")) {
            int posX = x + ((i / 2) * 150) + 8;
            int posY = y + (i % 2 * 50) + 10;

            RecipeData data = recipes.get(i);
            if (gui.func_146978_c(posX + ((0 % 2) * 18), posY + ((0 / 2) * 18) + 10, 16, 16, mouseX, mouseY)) {
                if (data.getIngredients().size() > 0) {
                    if (data.getIngredients().get(0) != null) {
                        gui.renderToolTip(data.getIngredients().get(0), mouseX, mouseY);
                    }
                }
            }
            if (gui.func_146978_c(posX + ((1 % 2) * 18), posY + ((1 / 2) * 18) + 10, 16, 16, mouseX, mouseY)) {
                if (data.getIngredients().size() > 1) {
                    if (data.getIngredients().get(1) != null) {
                        gui.renderToolTip(data.getIngredients().get(1), mouseX, mouseY);
                    }
                }
            }
            if (gui.func_146978_c(posX + ((2 % 2) * 18), posY + ((2 / 2) * 18) + 10, 16, 16, mouseX, mouseY)) {
                if (data.getIngredients().size() > 2) {
                    if (data.getIngredients().get(2) != null) {
                        gui.renderToolTip(data.getIngredients().get(2), mouseX, mouseY);
                    }
                }
            }
            if (gui.func_146978_c(posX + ((3 % 2) * 18), posY + ((3 / 2) * 18) + 10, 16, 16, mouseX, mouseY)) {
                if (data.getIngredients().size() > 3) {
                    if (data.getIngredients().get(3) != null) {
                        gui.renderToolTip(data.getIngredients().get(3), mouseX, mouseY);
                    }
                }
            }

            drawToolTip(gui, mc, posX + 80, posY + 20, mouseX, mouseY,
                    getDrink(data.getDrinkName(), data.getRed(), data.getGreen(), data.getBlue()));

        }
        if (type.equals("washingmachine")) {
            drawToolTip(gui, mc, x + ((i % 5) * 20) + ((i / 20) * 145) + 7,
                    y + ((i / 5) * 20) - ((i / 20) * (4 * 20)) + 30, mouseX, mouseY, recipes.get(i).getInput());
        }
        if (type.equals("dishwasher")) {
            drawToolTip(gui, mc, x + ((i % 5) * 20) + ((i / 20) * 145) + 7,
                    y + ((i / 5) * 20) - ((i / 20) * (4 * 20)) + 30, mouseX, mouseY, recipes.get(i).getInput());
        }
        if (type.equals("microwave")) {
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 15, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getInput());
            drawToolTip(gui, mc, x + ((i / 4) * 150) + 75, y + (i % 4 * spacing), mouseX, mouseY,
                    recipes.get(i).getOutput());
        }
    }
}

From source file:com.mrcrayfish.furniture.gui.RecipePage.java

License:Open Source License

private void drawOven(Minecraft mc, GuiRecipeBook gui, RecipeData data, int x, int y) {
    GL11.glEnable(GL11.GL_LIGHTING);// w w  w. j av a  2s  . co m
    gui.getItemRenderer().zLevel = 100.0F;
    gui.getItemRenderer().renderItemAndEffectIntoGUI(data.getInput(), x, y);
    gui.getItemRenderer().renderItemOverlays(gui.getFontRenderer(), data.getInput(), x, y);
    gui.getItemRenderer().renderItemAndEffectIntoGUI(data.getOutput(), x + 60, y);
    gui.getItemRenderer().renderItemOverlays(gui.getFontRenderer(), data.getOutput(), x + 60, y);
    gui.getItemRenderer().zLevel = 0.0F;
    GL11.glDisable(GL11.GL_LIGHTING);
}