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:cn.academy.vanilla.generic.client.render.RippleMarkRender.java

License:GNU General Public License

@Override
public void doRender(Entity entity, double x, double y, double z, float a, float b) {
    EntityRippleMark mark = (EntityRippleMark) entity;
    long dt = GameTimer.getTime() - mark.creationTime;

    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_DEPTH_TEST);//  w  w w .  j a  v  a2  s . com
    GL11.glAlphaFunc(GL11.GL_GREATER, 0);
    GL11.glDepthMask(false);
    GL11.glPushMatrix();

    GL11.glTranslated(x, y, z);

    for (int i = 0; i < timeOffsets.length; ++i) {
        GL11.glPushMatrix();

        long mod = (dt - timeOffsets[i]) % CYCLE;
        float size = getSize(mod);

        GL11.glTranslatef(0, getHeight(mod), 0);
        GL11.glScalef(size, 1, size);
        material.color = mark.color.copy();
        material.color.a *= getAlpha(mod);
        mesh.draw(material);

        GL11.glPopMatrix();
    }

    GL11.glPopMatrix();
    GL11.glDepthMask(true);
    GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1f);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
}

From source file:cn.academy.vanilla.meltdowner.client.render.RenderMdShield.java

License:GNU General Public License

@Override
public void doRender(Entity _entity, double x, double y, double z, float a, float b) {
    if (RenderUtils.isInShadowPass()) {
        return;// w ww . j  a v a2s. c om
    }

    long time = GameTimer.getTime();
    EntityMdShield entity = (EntityMdShield) _entity;

    // Calculate rotation
    long dt;
    if (entity.lastRender == 0)
        dt = 0;
    else
        dt = time - entity.lastRender;

    float rotationSpeed = MathUtils.lerpf(0.8f, 2f, Math.min(entity.ticksExisted / 30.0f, 1f));
    entity.rotation += rotationSpeed * dt;
    if (entity.rotation >= 360f)
        entity.rotation -= 360f;

    ShaderSimple.instance().useProgram();
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.05f);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glPushMatrix();

    GL11.glTranslated(x, y, z);
    GL11.glRotatef(-entity.rotationYaw, 0, 1, 0);
    GL11.glRotatef(entity.rotationPitch, 1, 0, 0);
    GL11.glRotatef(entity.rotation, 0, 0, 1);

    float size = EntityMdShield.SIZE * MathUtils.lerpf(0.2f, 1f, Math.min(entity.ticksExisted / 15.0f, 1f));
    float alpha = Math.min(entity.ticksExisted / 6.0f, 1.0f);

    GL11.glScalef(size, size, 1);

    RenderUtils.loadTexture(texture);
    mesh.draw(ShaderSimple.instance());

    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1f);
    GL20.glUseProgram(0);

    entity.lastRender = time;
}

From source file:cn.academy.vanilla.teleporter.client.MarkRender.java

License:GNU General Public License

@Override
public void doRender(Entity ent, double x, double y, double z, float var8, float var9) {
    if (RenderUtils.isInShadowPass())
        return;//from   w w w .  ja v a2s .  c  o  m

    EntityTPMarking mark = (EntityTPMarking) ent;
    if (!mark.firstUpdated())
        return;

    int texID = (int) ((mark.ticksExisted / 2.5) % tex.length);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_DEPTH_TEST);

    GL11.glPushMatrix();
    {
        GL11.glTranslated(x, y, z);

        GL11.glRotated(-mark.rotationYaw, 0, 1, 0);
        GL11.glScaled(-1, -1, 1);
        ShaderSimple.instance().useProgram();
        RenderUtils.loadTexture(tex[texID]);

        if (!mark.available) {
            GL11.glColor4d(1, 0.2, 0.2, 1);
        } else {
            GL11.glColor4d(1, 1, 1, 1);
        }

        model.draw();
        GL20.glUseProgram(0);
    }
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_CULL_FACE);
}

From source file:cn.academy.vanilla.teleporter.client.RenderMarker.java

License:GNU General Public License

@Override
public void doRender(Entity ent, double x, double y, double z, float a, float b) {
    EntityMarker marker = (EntityMarker) ent;
    if (!marker.firstUpdated())
        return;//w  ww .  j av a 2 s.c  o m

    Entity targ = marker.target;
    float width, height;
    if (targ != null) {
        width = targ.width;
        height = targ.height;
    } else {
        width = marker.width;
        height = marker.height;
    }

    ShaderNotex.instance().useProgram();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    if (marker.ignoreDepth)
        GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glPushMatrix();

    GL11.glTranslated(x - width / 2, y + 0.05 * Math.sin(GameTimer.getAbsTime() / 400.0), z - width / 2);
    marker.color.bind();
    renderMark(width, height);

    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL20.glUseProgram(0);
}

From source file:cn.lambdacraft.crafting.block.crafter.GuiElectricCrafter.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glPushMatrix();/*from  w  w w . j a  v a 2  s .c  o m*/
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    RenderUtils.loadTexture(ClientProps.GUI_ELCRAFTER_PATH);
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    int height = tileEntity.heatForRendering * 46 / tileEntity.maxHeat;
    if (height > 0) {
        drawTexturedModalRect(x + 138, y + 63 - height, 181, 0, 6, height);
    }
    height = tileEntity.currentEnergy * 46 / TileElCrafter.MAX_STORAGE;
    if (height > 0) {
        drawTexturedModalRect(x + 116, y + 63 - height, 174, 0, 6, height);
    }
    if (tileEntity.isCrafting && tileEntity.currentRecipe != null) {
        if (tileEntity.heatRequired > 0) {
            height = tileEntity.heatRequired * 46 / tileEntity.maxHeat;
            drawTexturedModalRect(x + 136, y + 63 - height, 207, 1, 6, 3);
        }
    }

    this.drawElements(i, j);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:cn.lambdacraft.crafting.client.gui.GuiBatBox.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glPushMatrix();//  www. ja  v a  2s  .com
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(ClientProps.GUI_BATBOX_PATH);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);

    if (te.currentEnergy > 0) {
        int len = te.currentEnergy * 68 / te.maxStorage;
        this.drawTexturedModalRect(x + 53, y + 38, 173, 10, len, 7);
    }

    this.drawElements();
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:cn.lambdacraft.crafting.client.gui.GuiElectricCrafter.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glPushMatrix();//w ww  . j  a v  a2  s.  c o  m
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    bindTexture(ClientProps.GUI_ELCRAFTER_PATH);
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    int height = tileEntity.heatForRendering * 46 / tileEntity.maxHeat;
    if (height > 0) {
        drawTexturedModalRect(x + 138, y + 63 - height, 181, 0, 6, height);
    }
    height = tileEntity.currentEnergy * 46 / TileElCrafter.MAX_STORAGE;
    if (height > 0) {
        drawTexturedModalRect(x + 116, y + 63 - height, 174, 0, 6, height);
    }
    if (tileEntity.isCrafting && tileEntity.currentRecipe != null) {
        if (tileEntity.heatRequired > 0) {
            height = tileEntity.heatRequired * 46 / tileEntity.maxHeat;
            drawTexturedModalRect(x + 136, y + 63 - height, 207, 1, 6, 3);
        }
    }
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:cn.lambdacraft.crafting.client.gui.GuiGenFire.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glPushMatrix();//from   w  w w. j a v  a  2 s.  c  o  m
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    bindTexture(ClientProps.GUI_GENFIRE_PATH);
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    int len = 0;
    if (te.maxBurnTime > 0) {
        len = te.tickLeft * 39 / te.maxBurnTime;
        this.drawTexturedModalRect(x + 109, y + 52, 173, 0, len, 3);
    }
    len = te.currentEnergy * 50 / te.maxStorage;
    if (len > 0)
        this.drawTexturedModalRect(x + 75, y + 65 - len, 173, 55 - len, 14, len);
    this.drawElements();
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:cn.lambdacraft.crafting.client.gui.GuiGenLava.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glPushMatrix();//from www.j  av  a2s. c  om
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    bindTexture(ClientProps.GUI_GENLAVA_PATH);
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    int len = 0;
    len = te.bucketCnt * 47 / te.maxStorage;
    len += Math.round(2.35F * te.currentEnergy / TileGeneratorLava.ENERGY_PER_BUCKET);
    this.drawTexturedModalRect(x + 91, y + 65 - len, 173, 59 - len, 6, len);
    this.drawElements();
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}

From source file:cn.lambdacraft.crafting.client.gui.GuiGenSolar.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glPushMatrix();/*from   ww  w .  ja v  a2  s .c o m*/
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    bindTexture(ClientProps.GUI_GENSOLAR_PATH);
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    int len = 0;
    len = te.currentEnergy * 48 / te.maxStorage;
    if (len > 0)
        this.drawTexturedModalRect(x + 24, y + 52, 174, 70, len, 7);
    if (te.worldObj.isDaytime()) {
        this.drawTexturedModalRect(x + 13, y + 19, 173, 0, 60, 30);
        this.drawTexturedModalRect(x + 86, y + 44, 186, 9, 5, 5);
    } else {
        this.drawTexturedModalRect(x + 13, y + 19, 173, 34, 60, 30);
        this.drawTexturedModalRect(x + 86, y + 44, 186, 44, 5, 5);
    }
    this.drawElements();
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
}