Example usage for org.lwjgl.opengl GL11 glColor4d

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

Introduction

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

Prototype

public static native void glColor4d(@NativeType("GLdouble") double red, @NativeType("GLdouble") double green,
        @NativeType("GLdouble") double blue, @NativeType("GLdouble") double alpha);

Source Link

Document

Double version of #glColor4b Color4b

Usage

From source file:fr.ign.cogit.geoxygene.util.gl.GLTools.java

License:Open Source License

/**
 * set gl color from a LWJGL Color object
 *///ww  w .  j a  va2s . com
public static void glColor(final Color color) {
    GL11.glColor4d(color.getRed() / 255., color.getGreen() / 255., color.getBlue() / 255.,
            color.getAlpha() / 255.);
}

From source file:fr.ign.cogit.geoxygene.util.gl.GLTools.java

License:Open Source License

/**
 * set gl color from an AWT Color object
 *//*from   ww w  . j a  v  a  2s .  c om*/
public static void glColor(final java.awt.Color color) {
    GL11.glColor4d(color.getRed() / 255., color.getGreen() / 255., color.getBlue() / 255.,
            color.getAlpha() / 255.);

}

From source file:game.entities.Box.java

License:Open Source License

@Override
public void render(Render render) {
    switch (this.sides) {
    case 4:/*  www .j  av a2s .c  om*/
        GL11.glColor4d(1, 0.2, 0.0, 0.001);
        render.drawSquare(this.position, max);
    case 1:
        byte[] b = { 61, 8, 122, 126 };
        GL11.glColor4b(b[0], b[1], b[2], b[3]);
        ArrayList<Point> p = new ArrayList<Point>();
        p.add(this.getMax());
        p.add(new Point(this.getMax().getX(), this.getPosition().getY()));
        p.add(this.getPosition());
        p.add(new Point(this.getPosition().getX(), this.getMax().getY()));
        render.drawLines(p);
    }

    this.liquid.render(this, render);
}

From source file:game.Liquid.java

License:Open Source License

public void render(Box box, Render render) {
    GL11.glColor4d(color[0], color[1], color[2], color[3]);
    render.drawSquare(box.getPosition(), new Point(box.getMax().getX(),
            box.getPosition().getY() + ((box.getMax().getY() - box.getPosition().getY()) * this.getLevel())));
}

From source file:matteroverdrive.gui.element.ElementStates.java

License:Open Source License

@Override
public void drawForeground(int mouseX, int mouseY) {
    super.drawForeground(mouseX, mouseY);
    GL11.glColor4d(1, 1, 1, 1);
    GL11.glEnable(GL11.GL_ALPHA_TEST);/*from w w w.j a  v  a2s.  c o m*/
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.5f);
    GL11.glCullFace(GL11.GL_BACK);
    int width = getFontRenderer().getStringWidth(label);
    getFontRenderer().drawString(label, posX + sizeX + 4, posY - getFontRenderer().FONT_HEIGHT / 2 + sizeY / 2,
            getTextColor());
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

/**
 * Renders a box with any size and any color.
 *
 * @param x/*  w w  w .j av  a2 s .c  o  m*/
 * @param y
 * @param z
 * @param x2
 * @param y2
 * @param z2
 * @param color
 */
public static void box(double x, double y, double z, double x2, double y2, double z2, Color color) {
    x = x - Minecraft.getMinecraft().getRenderManager().renderPosX;
    y = y - Minecraft.getMinecraft().getRenderManager().renderPosY;
    z = z - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    x2 = x2 - Minecraft.getMinecraft().getRenderManager().renderPosX;
    y2 = y2 - Minecraft.getMinecraft().getRenderManager().renderPosY;
    z2 = z2 - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(2.0F);
    RenderUtil.setColor(color);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    drawColorBox(new AxisAlignedBB(x, y, z, x2, y2, z2));
    GL11.glColor4d(0, 0, 0, 0.5F);
    RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2), -1);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

/**
 * Renders an ESP box with the size of a normal block at the specified
 * coordinates.//from   ww  w .  j  a  va2  s  . c  om
 *
 * @param x
 * @param y
 * @param z
 */
public static void blockESPBox(BlockPos blockPos) {
    double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
    double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
    double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(1.0F);
    GL11.glColor4d(0, 1, 0, 0.15F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
    GL11.glColor4d(0, 0, 0, 0.5F);
    RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), -1);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

public static void framelessBlockESP(BlockPos blockPos, Color color) {
    double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
    double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
    double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);/*  w  w  w  .  j a  v  a 2 s. co  m*/
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(2.0F);
    GL11.glColor4d(color.getRed() / 255, color.getGreen() / 255, color.getBlue() / 255, 0.15);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

public static void emptyBlockESPBox(BlockPos blockPos) {
    double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
    double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
    double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);//from  w  w  w .  ja  v a  2s  .  c om
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(2.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    GL11.glColor4d(0, 0, 0, 0.5F);
    RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), -1);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

public static void entityESPBox(Entity entity, int mode) {
    GL11.glBlendFunc(770, 771);/*  www  .j ava2  s.co  m*/
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(2.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    if (mode == 0)// Enemy
        GL11.glColor4d(1 - Minecraft.getMinecraft().thePlayer.getDistanceToEntity(entity) / 40,
                Minecraft.getMinecraft().thePlayer.getDistanceToEntity(entity) / 40, 0, 0.5F);
    else if (mode == 1)// Friend
        GL11.glColor4d(0, 0, 1, 0.5F);
    else if (mode == 2)// Other
        GL11.glColor4d(1, 1, 0, 0.5F);
    else if (mode == 3)// Target
        GL11.glColor4d(1, 0, 0, 0.5F);
    else if (mode == 4)// Team
        GL11.glColor4d(0, 1, 0, 0.5F);
    Minecraft.getMinecraft().getRenderManager();
    RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(
            entity.boundingBox.minX - 0.05 - entity.posX
                    + (entity.posX - Minecraft.getMinecraft().getRenderManager().renderPosX),
            entity.boundingBox.minY - entity.posY
                    + (entity.posY - Minecraft.getMinecraft().getRenderManager().renderPosY),
            entity.boundingBox.minZ - 0.05 - entity.posZ
                    + (entity.posZ - Minecraft.getMinecraft().getRenderManager().renderPosZ),
            entity.boundingBox.maxX + 0.05 - entity.posX
                    + (entity.posX - Minecraft.getMinecraft().getRenderManager().renderPosX),
            entity.boundingBox.maxY + 0.1 - entity.posY
                    + (entity.posY - Minecraft.getMinecraft().getRenderManager().renderPosY),
            entity.boundingBox.maxZ + 0.05 - entity.posZ
                    + (entity.posZ - Minecraft.getMinecraft().getRenderManager().renderPosZ)),
            -1);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}