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.shinoow.abyssalcraft.client.render.entity.RenderDragonBoss.java

License:Apache License

/**
 * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass.
 *//* ww  w . j ava  2s . c om*/
protected int renderGlow(EntityDragonBoss par1entitydragonboss, int par2, float par3) {
    if (par2 == 1)
        GL11.glDepthFunc(GL11.GL_LEQUAL);

    if (par2 != 0)
        return -1;
    else {
        bindTexture(field_110845_h);
        float f1 = 1.0F;
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDepthFunc(GL11.GL_EQUAL);
        char c0 = 61680;
        int j = c0 % 65536;
        int k = c0 / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
        return 1;
    }
}

From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonMinion.java

License:Apache License

/**
 * Renders the dragon model. Called by renderModel.
 *//*from w  w w  . jav  a2s.c o m*/
protected void renderDragonModel(EntityDragonMinion par1EntityDragonMinion, float par2, float par3, float par4,
        float par5, float par6, float par7) {
    bindEntityTexture(par1EntityDragonMinion);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    mainModel.render(par1EntityDragonMinion, par2, par3, par4, par5, par6, par7);
    GL11.glDisable(GL11.GL_BLEND);

    if (par1EntityDragonMinion.hurtTime > 0) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F);
        mainModel.render(par1EntityDragonMinion, par2, par3, par4, par5, par6, par7);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glDepthFunc(GL11.GL_LEQUAL);
    }
}

From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonMinion.java

License:Apache License

/**
 * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass.
 *//*from w w  w . j  a v a 2 s  .  co  m*/
protected int renderGlow(EntityDragonMinion par1EntityDragonMinion, int par2, float par3) {
    if (par2 == 1)
        GL11.glDepthFunc(GL11.GL_LEQUAL);

    if (par2 != 0)
        return -1;
    else {
        bindTexture(field_110845_h);
        float f1 = 1.0F;
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDepthFunc(GL11.GL_EQUAL);
        char c0 = 61680;
        int j = c0 % 65536;
        int k = c0 / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
        return 1;
    }
}

From source file:com.shinoow.abyssalcraft.common.items.armor.ItemDepthsArmor.java

License:Apache License

@Override
@SideOnly(Side.CLIENT)// w  ww .  j a  va  2 s. c o  m
public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution,
        float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
    final ResourceLocation coraliumBlur = new ResourceLocation("abyssalcraft:textures/misc/coraliumblur.png");

    if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && stack != null
            && stack.getItem() == AbyssalCraft.Depthshelmet) {
        GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);

        Tessellator t = Tessellator.instance;

        ScaledResolution scale = new ScaledResolution(Minecraft.getMinecraft(),
                Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
        int width = scale.getScaledWidth();
        int height = scale.getScaledHeight();

        GL11.glDisable(GL11.GL_DEPTH_TEST);
        GL11.glDepthMask(false);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        Minecraft.getMinecraft().renderEngine.bindTexture(coraliumBlur);

        t.startDrawingQuads();
        t.addVertexWithUV(0.0D, height, 90.0D, 0.0D, 1.0D);
        t.addVertexWithUV(width, height, 90.0D, 1.0D, 1.0D);
        t.addVertexWithUV(width, 0.0D, 90.0D, 1.0D, 0.0D);
        t.addVertexWithUV(0.0D, 0.0D, 90.0D, 0.0D, 0.0D);
        t.draw();

        GL11.glPopAttrib();
    }
}

From source file:com.smithsmodding.smithscore.util.client.gui.GuiHelper.java

/**
 * Disables all Scissors currently active
 */
public static void disableScissor() {

    GL11.glDisable(GL11.GL_SCISSOR_TEST);
    GL11.glPopAttrib();

}

From source file:com.spawck.hs2.client.renderer.model.ModelSoul.java

License:GNU General Public License

@Override
public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7) {
    GL11.glPushMatrix();/*from  w  w w . j  a v  a 2  s .c o  m*/
    GL11.glScalef(1.0F, 1.0F, 1.0F);
    GL11.glTranslatef(0.0F, -0.5F, 0.0F);

    if (this.base != null) {
        this.base.render(par7);
    }

    GL11.glEnable(2977);
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(0.0F, 0.8F + par4, 0.0F);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    this.glass.render(par7);
    float var8 = 0.875F;
    GL11.glScalef(var8, var8, var8);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    this.glass.render(par7);
    GL11.glScalef(var8, var8, var8);
    GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
    GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F);
    this.cube.render(par7);
    GL11.glDepthFunc(514);
    GL11.glDisable(2896);
    GL11.glEnable(3042);
    GL11.glBlendFunc(768, 1);
    float var14 = 0.76F;
    GL11.glColor4f(0.5F * var14, 0.25F * var14, 0.8F * var14, 1.0F);
    GL11.glMatrixMode(5890);
    GL11.glPushMatrix();
    float var15 = 0.125F;
    GL11.glScalef(var15, var15, var15);
    float var16 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
    GL11.glTranslatef(var16, 0.0F, 0.0F);
    GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
    this.cube.render(par7);
    GL11.glPopMatrix();
    GL11.glPushMatrix();
    GL11.glScalef(var15, var15, var15);
    var16 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
    GL11.glTranslatef(-var16, 0.0F, 0.0F);
    GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
    this.cube.render(par7);
    GL11.glPopMatrix();
    GL11.glMatrixMode(5888);
    GL11.glDisable(3042);
    GL11.glEnable(2896);
    GL11.glDepthFunc(515);
    GL11.glPopMatrix();
}

From source file:com.specialeffect.gui.IconOverlay.java

License:Open Source License

private void drawTexture() {
    // calculate position
    int height = (int) (mDisplayHeight * mHeight);
    int width = (int) (height * mAspectRatio);
    int centreX = (int) (mCentreX * mDisplayWidth);
    int centreY = (int) (mCentreY * mDisplayHeight);

    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glPushAttrib(GL11.GL_TEXTURE_BIT);

    this.mc.renderEngine.bindTexture(mResource);

    GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_ADD);

    GL11.glColor4f(1.0f, 1.0f, 1.0f, mAlpha);

    ModUtils.drawTexQuad(centreX - width / 2, centreY - height / 2, width, height);

    // reset GL attributes!
    GL11.glPopAttrib();/*  w ww . j  a  v a2s.c  o m*/

}

From source file:com.specialeffect.gui.JoystickControlOverlay.java

License:Open Source License

@SubscribeEvent
public void onRenderExperienceBar(RenderGameOverlayEvent event) {

    // We draw after the ExperienceBar has drawn.  The event raised by GuiIngameForge.pre()
    // will return true from isCancelable.  If you call event.setCanceled(true) in
    // that case, the portion of rendering which this event represents will be canceled.
    // We want to draw *after* the experience bar is drawn, so we make sure isCancelable() returns
    // false and that the eventType represents the ExperienceBar event.
    if (event.isCancelable() || event.getType() != ElementType.EXPERIENCE) {
        return;//from w  w  w  .j a v a2  s . c o  m
    }

    if (mVisible) {

        this.rescale();

        GL11.glDisable(GL11.GL_LIGHTING);

        this.mc.renderEngine.bindTexture(mResource);

        GL11.glPushAttrib(GL11.GL_TEXTURE_BIT);
        GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_ADD);

        GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.5f);

        ModUtils.drawTexQuad(0, 0, mDisplayWidth, mDisplayHeight);

        // reset GL attributes!
        GL11.glPopAttrib();
    }

}

From source file:com.specialeffect.gui.StateOverlay.java

License:Open Source License

@SubscribeEvent
public void onRenderExperienceBar(RenderGameOverlayEvent event) {

    // We draw after the ExperienceBar has drawn.  The event raised by GuiIngameForge.pre()
    // will return true from isCancelable.  If you call event.setCanceled(true) in
    // that case, the portion of rendering which this event represents will be canceled.
    // We want to draw *after* the experience bar is drawn, so we make sure isCancelable() returns
    // false and that the eventType represents the ExperienceBar event.
    if (event.isCancelable() || event.getType() != ElementType.EXPERIENCE) {
        return;/*  ww w.  j av  a 2  s .  c  om*/
    }

    // Don't show if the debug screen is open
    if (Minecraft.getMinecraft().gameSettings.showDebugInfo) {
        return;
    }

    this.rescale();

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_LIGHTING);

    // LEFT icons
    int xPos = mIconPadding;
    int yPos = mIconPadding;
    for (int i = 0; i < mResourcesLeft.size(); i++) {
        if (mFlagsLeft.get(i)) {
            drawScaledTextureWithGlow(mResourcesLeft.get(i), xPos, yPos, mIconSize, mIconSize);
        }
        xPos += mIconSize + mIconPadding;
    }

    // RIGHT ICONS
    xPos = mDisplayWidth - mIconSize - mIconPadding;
    for (int i = 0; i < mResourcesRight.size(); i++) {
        if (mFlagsRight.get(i)) {
            drawScaledTextureWithGlow(mResourcesRight.get(i), xPos, yPos, mIconSize, mIconSize);
        }
        xPos -= (mIconSize + mIconPadding);
    }
}

From source file:com.sr2610.steampunkd.handbook.pages.PageCraftingRecipe.java

License:Creative Commons License

@Override
@SideOnly(Side.CLIENT)//from   www .jav  a  2 s .  c om
public void renderRecipe(IGuiHandbookEntry gui, int mx, int my) {

    final FontRenderer fontRendererObj = ((GuiScreen) gui).mc.fontRendererObj;

    final boolean unicode = fontRendererObj.getUnicodeFlag();
    fontRendererObj.setUnicodeFlag(true);
    fontRendererObj.setUnicodeFlag(unicode);

    oreDictRecipe = shapelessRecipe = false;

    final IRecipe recipe = recipes.get(recipeAt);
    renderCraftingRecipe(gui, recipe);

    final TextureManager render = Minecraft.getMinecraft().renderEngine;
    render.bindTexture(craftingOverlay);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1F, 1F, 1F, 1F);
    ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop() + 10, 0, 0, gui.getWidth(),
            gui.getHeight());

    int iconX = gui.getLeft() + 115;
    final int iconY = gui.getTop() + 12 + 10;

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

    if (shapelessRecipe) {
        ((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 0, 16, 16);

        if ((mx >= iconX) && (my >= iconY) && (mx < (iconX + 16)) && (my < (iconY + 16)))
            TooltipHelper.renderTooltip(mx, my, Arrays.asList(I18n.format("steampunkd.handbook.shapeless")));

        iconX = gui.getLeft() + 95;
    }

    render.bindTexture(craftingOverlay);
    GL11.glEnable(GL11.GL_BLEND);

    if (oreDictRecipe) {
        ((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 16, 16, 16);

        if ((mx >= iconX) && (my >= iconY) && (mx < (iconX + 16)) && (my < (iconY + 16)))
            TooltipHelper.renderTooltip(mx, my, Arrays.asList(I18n.format("steampunked.handbook.oredict")));
    }

    if (oreDictRecipe)
        ((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 16, 16, 16);
    GL11.glDisable(GL11.GL_BLEND);
}