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.ability.teleport.client.render.entity.MarkRender.java

License:Open Source License

@Override
public void doRender(Entity ent, double x, double y, double z, float var8, float var9) {
    EntityTPMarking mark = (EntityTPMarking) ent;
    int texID = (int) ((mark.ticksExisted / 2.5) % tex.length);

    GL11.glEnable(GL11.GL_BLEND);/*from w  w  w  .j a va 2  s .c  o m*/
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glColor4d(1, 1, 1, 1);
    GL11.glPushMatrix();
    {
        GL11.glTranslated(x, y, z);

        GL11.glRotated(-mark.rotationYaw, 0, 1, 0);
        GL11.glScaled(-1, -1, 1);
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
        Tessellator.instance.setBrightness(15728880);
        RenderUtils.loadTexture(tex[texID]);
        model.draw();
    }
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_CULL_FACE);
}

From source file:cn.academy.core.client.ACRenderingHelper.java

License:GNU General Public License

public static void drawGlow(double x, double y, double width, double height, double size, Color glowColor) {
    glowColor.bind();/*from   ww w .  jav a 2  s .com*/

    final double s = size;
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    Tessellator t = Tessellator.instance;
    gdraw(GLOW_L, x - s, y, s, height);
    gdraw(GLOW_R, x + width, y, s, height);
    gdraw(GLOW_U, x, y - s, width, s);
    gdraw(GLOW_D, x, y + height, width, s);
    gdraw(GLOW_RU, x + width, y - s, s, s);
    gdraw(GLOW_RD, x + width, y + height, s, s);
    gdraw(GLOW_LU, x - s, y - s, s, s);
    gdraw(GLOW_LD, x - s, y + height, s, s);
}

From source file:cn.academy.core.client.ACRenderingHelper.java

License:GNU General Public License

public static void lineSegment(double x0, double y0, double x1, double y1, float width) {
    boolean pre = GL11.glIsEnabled(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    dirQuad(x0, y0, x1, y1, width);// w  ww .  java 2  s.co m

    if (pre)
        GL11.glEnable(GL11.GL_TEXTURE_2D);
}

From source file:cn.academy.core.client.gui.dev.PageMain.java

License:Open Source License

private void drawPlayer() {
    EntityPlayer player = dev.user;//from   w w  w  .  ja  va2  s. c  o  m
    RenderUtils.loadTexture(RenderUtils.STEVE_TEXTURE);
    float x = 100, y = 100, scale = 2.1F;
    GL11.glEnable(GL11.GL_COLOR_MATERIAL);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDepthFunc(GL11.GL_LEQUAL);
    GL11.glPushMatrix();
    {
        GL11.glTranslatef(183, 58, 100F);
        GL11.glScalef((-scale), scale, scale);
        GL11.glRotated(-25, 1, 0, 0);
        RenderHelper.enableStandardItemLighting();
        GL11.glRotatef(Minecraft.getSystemTime() / 100F, 0F, 1F, 0F); //Rotate around Y
        model.render(player, 0, 0, 0, 0, 0, 1F);
    }
    GL11.glPopMatrix();
    RenderHelper.disableStandardItemLighting();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
    GL11.glDepthFunc(GL11.GL_ALWAYS);
}

From source file:cn.academy.core.client.gui.GuiMainScreen.java

License:Open Source License

@Override
public void draw(ScaledResolution sr) {
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;
    AbilityData data = AbilityDataMain.getData(player);
    double w = sr.getScaledWidth_double(), h = sr.getScaledHeight_double();
    double size = 80.0, x = w - 80, y = h - 65;
    boolean active = EventHandlerClient.isSkillEnabled();
    long time = Minecraft.getSystemTime();

    GL11.glEnable(GL11.GL_BLEND);//  ww  w.j  av a  2 s.c  om
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glPushMatrix();
    {
        GL11.glPushMatrix();
        { //Logo rendering
            double scale = .25;
            double mAlpha = active ? 0.8 : 0.4;
            HudUtils.setTextureResolution(256, 256);

            GL11.glTranslated(w - 80, h - 70, 0);
            GL11.glScaled(scale, scale, 1);

            GL11.glColor4d(1, 1, 1, mAlpha);
            logoBack.draw();

            GL11.glColor4d(1, 1, 1, (mAlpha * 1.25) * (0.7 + Math.sin(time / 900D) * 0.3));
            logoRays.draw();

            GL11.glColor4d(1, 1, 1, mAlpha);
            logoBack.draw();
            logoFrame.draw();

            RenderUtils.loadTexture(data.getCategory().getLogo());
            HudUtils.drawRect(63, 63, 129, 129);

            logoGeom.getTransform().setRoll(time / 1000D);
            logoGeom.draw();
        }
        GL11.glPopMatrix();
        RenderUtils.bindIdentity();

        //CPBar rendering
        if (active) {
            lastActiveTime = time;
        } else {
            lastInactiveTime = time;
        }
        double mAlpha = active ? Math.min((time - lastInactiveTime) / 300D, 1.0)
                : Math.max((300 + lastActiveTime - time) / 300D, 0.0);

        if (mAlpha > 0) {
            //Cooldown
            drawCooldownBars(data, mAlpha, w, h);

            GL11.glColor4d(1, 1, 1, mAlpha * 0.6);
            RenderUtils.loadTexture(ACClientProps.TEX_HUD_BAR);
            HudUtils.setTextureResolution(512, 200);
            double scale = .4;
            GL11.glTranslated(w - 193, 17, 0);
            GL11.glScaled(scale, scale, 0);
            //Back
            HudUtils.drawRect(0, 0, 0, 73, 455, 127, 455, 127);

            //CPBar
            double prog = data.getCurrentCP() / data.getMaxCP();
            int[] cs = data.getCategory().getColorStyle();
            RenderUtils.bindColor(cs[0], cs[1], cs[2], (int) (mAlpha * 255));
            HudUtils.drawRect(439 - 436 * prog, 3, 439 - 436 * prog, 4, 436 * prog, 28, 436 * prog, 28);

            //CPBar glow
            double alpha = Math.max(0, (prog - 0.6) / 0.4);
            GL11.glColor4d(1, 1, 1, alpha * mAlpha);
            HudUtils.drawRect(3, 3, 3, 42, 436, 28, 436, 28);

            //Chip
            HudUtils.drawRect(269, 46, 478, 40, 26, 26, 26, 26);
            alpha = 0.5 + 0.5 * Math.sin(Minecraft.getSystemTime() / 500D);
            RenderUtils.bindColor(cs[0], cs[1], cs[2], (int) (alpha * mAlpha * 255)); //Chip glow light
            HudUtils.drawRect(266, 45, 474, 5, 32, 32, 32, 32);

            //Level
            GL11.glColor4d(1, 1, 1, mAlpha * .6);
            ACClientProps.FONT_YAHEI_32.drawAdjusted(data.getLevel().getDisplayName(), 184, 58, 20, 69);

            //Numeric CP
            String str = String.format("%.0f/%.0f", data.getCurrentCP(), data.getMaxCP());
            font.drawAdjusted(str, 316, 87, 22, Align.CENTER, 167);
        }
    }
    GL11.glPopMatrix();
    RenderUtils.bindIdentity();
    GL11.glDisable(GL11.GL_BLEND);
}

From source file:cn.academy.core.client.gui.GuiPresetSelect.java

License:Open Source License

@Override
public void draw(ScaledResolution sr) {
    int h = sr.getScaledHeight(), w = sr.getScaledWidth();
    GL11.glEnable(GL11.GL_BLEND);//from  w w  w. j  a  va  2  s  .  c o  m
    GL11.glPushMatrix();
    {
        float x0 = w / 2F, y0 = h / 2F, scale = 0.32F;
        GL11.glTranslated(0, -5, 0);
        GL11.glTranslatef(x0, y0, 0);
        GL11.glScalef(scale, scale, 1);

        HudUtils.setTextureResolution(768, 512);
        RenderUtils.loadTexture(ACClientProps.TEX_GUI_PRESET);
        long dt = Minecraft.getSystemTime() - lastOpenTime;
        drawSelectionMenu(w, h, dt);
        drawPresetInfo(w, h, dt);
        drawTag(w, h, dt);
    }
    GL11.glPopMatrix();
    GL11.glDisable(GL11.GL_BLEND);
}

From source file:cn.academy.core.client.render.ray.RendererRayCylinder.java

License:GNU General Public License

@Override
protected void draw(Entity entity, double len) {
    if (RenderUtils.isInShadowPass())
        return;/* w w w .  ja  v a 2 s.c o  m*/

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glPushMatrix();

    IRay ray = (IRay) entity;

    //HACK: Store the previous alpha
    double oldA = color.a;
    color.a *= ray.getAlpha();

    double width = this.width * ray.getWidth();

    color.bind();
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glPushMatrix();
    double offset = width * (1 - headFix);
    GL11.glTranslated(offset, 0, 0);
    GL11.glScaled(width * headFix, width, width);
    head.draw(shader);
    GL11.glPopMatrix();

    //Draw the cylinder
    GL11.glPushMatrix();
    GL11.glTranslated(width, 0, 0);
    GL11.glScaled(len - width, width, width);
    cylinder.draw(shader);
    GL11.glPopMatrix();

    GL11.glPushMatrix();
    GL11.glTranslated(len + width - offset, 0, 0);
    GL11.glScaled(-width * headFix, width, -width);
    head.draw(shader);
    GL11.glPopMatrix();

    GL11.glPopMatrix();

    color.a = oldA;
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glColor4d(1, 1, 1, 1);
}

From source file:cn.academy.core.client.render.RenderVoid.java

License:Open Source License

public static final void renderHand(EntityPlayer player) {

    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glPushMatrix();//ww w  . j a  va  2  s.  c o m

    RenderUtils.renderEnchantGlint_Equip();
    RenderUtils.loadTexture(steveTexture);
    GL11.glRotated(-23.75, 0.0F, 0.0F, 1.0F);
    GL11.glRotated(21.914, 0.0F, 1.0F, 0.0F);
    GL11.glRotated(32.75, 1.0F, 0.0F, 0.0F);
    GL11.glTranslatef(.758F, -.072F, -.402F);
    GL11.glColor3f(1.0F, 1.0F, 1.0F);

    model.onGround = 0.0F;
    model.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, player);
    model.bipedRightArm.render(0.0625F);

    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_CULL_FACE);
}

From source file:cn.academy.core.client.render.shader.ShaderMask.java

License:GNU General Public License

public void end() {
    GL13.glActiveTexture(GL13.GL_TEXTURE0 + MASK_TEXID);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL20.glUseProgram(0);
}

From source file:cn.academy.core.client.render.SkillRenderDebug.java

License:Open Source License

@SideOnly(Side.CLIENT)
@Override/* ww  w.  jav a2  s.  c  om*/
public void renderSurroundings(EntityPlayer player, long time) {
    GL11.glPushMatrix();
    {
        GL11.glTranslated(-.5, 0, -.5);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1, 1, 1, 0.3F);
        RenderUtils.drawCube(1, 1, 2);
        GL11.glDisable(GL11.GL_BLEND);
    }
    GL11.glPopMatrix();
}