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:com.darkcart.xdolf.util.RenderUtils.java

License:Open Source License

public static void drawChestESP(double d, double d1, double d2, double r, double b, double g, double length,
        double length2) {
    GL11.glPushMatrix();//w  w  w  . j  ava 2s .co  m
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    GL11.glLineWidth(1.5F);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glLineWidth(1.0F);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);
    GL11.glDisable(2929);
    GL11.glDepthMask(false);
    GL11.glColor4d(r, g, b, 0.15);
    drawColorBox(new AxisAlignedBB(d, d1, d2, d + length2, d1 + 1.0, d2 + length), 0F, 0F, 0F, 0F);
    GL11.glColor4d(0, 0, 0, 0.5);
    drawSelectionBoundingBox(new AxisAlignedBB(d, d1, d2, d + length2, d1 + 1.0, d2 + length));
    GL11.glLineWidth(2.0F);
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(2929);
    GL11.glDepthMask(true);
    GL11.glDisable(3042);
    GL11.glPopMatrix();
}

From source file:com.darkcart.xdolf.util.RenderUtils.java

License:Open Source License

public static void drawLogoutESP(double d, double d1, double d2, double r, double b, double g) {
    GL11.glPushMatrix();/* w  ww  . j a v  a  2  s  . c o  m*/
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    GL11.glLineWidth(1.5F);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glLineWidth(1.0F);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);
    GL11.glDisable(2929);
    GL11.glDepthMask(false);
    GL11.glColor4d(r, g, b, 0.1825F);
    drawBoundingBox(new AxisAlignedBB(d, d1, d2, d + 1.0, d1 + 2.0, d2 + 1.0));
    GL11.glColor4d(r, g, b, 1.0F);
    drawOutlinedBoundingBox(new AxisAlignedBB(d, d1, d2, d + 1.0, d1 + 2.0, d2 + 1.0));
    GL11.glLineWidth(2.0F);
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(2929);
    GL11.glDepthMask(true);
    GL11.glDisable(3042);
    GL11.glPopMatrix();
}

From source file:com.darkcart.xdolf.util.RenderUtils.java

License:Open Source License

public static void drawEntityESP(Entity entity, Color c) {
    GL11.glPushMatrix();//from   www .j  a v a 2 s.c o m
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(1.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    GL11.glColor4d(c.getRed() / 255f, c.getGreen() / 255f, c.getBlue() / 255f, 0.15F);
    RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
    drawColorBox(
            new AxisAlignedBB(
                    entity.boundingBox.minX - 0.05 - entity.posX + (entity.posX - renderManager.renderPosX),
                    entity.boundingBox.minY - entity.posY + (entity.posY - renderManager.renderPosY),
                    entity.boundingBox.minZ - 0.05 - entity.posZ + (entity.posZ - renderManager.renderPosZ),
                    entity.boundingBox.maxX + 0.05 - entity.posX + (entity.posX - renderManager.renderPosX),
                    entity.boundingBox.maxY + 0.1 - entity.posY + (entity.posY - renderManager.renderPosY),
                    entity.boundingBox.maxZ + 0.05 - entity.posZ + (entity.posZ - renderManager.renderPosZ)),
            0F, 0F, 0F, 0F);
    GL11.glColor4d(0, 0, 0, 0.5);
    drawSelectionBoundingBox(new AxisAlignedBB(
            entity.boundingBox.minX - 0.05 - entity.posX + (entity.posX - renderManager.renderPosX),
            entity.boundingBox.minY - entity.posY + (entity.posY - renderManager.renderPosY),
            entity.boundingBox.minZ - 0.05 - entity.posZ + (entity.posZ - renderManager.renderPosZ),
            entity.boundingBox.maxX + 0.05 - entity.posX + (entity.posX - renderManager.renderPosX),
            entity.boundingBox.maxY + 0.1 - entity.posY + (entity.posY - renderManager.renderPosY),
            entity.boundingBox.maxZ + 0.05 - entity.posZ + (entity.posZ - renderManager.renderPosZ)));
    GL11.glLineWidth(2.0F);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
    GL11.glPopMatrix();
}

From source file:com.farincorporated.frameutils.client.gui.GUIFrameField.java

private void drawGUI() {
    GL11.glColor4d(1.0, 1.0, 1.0, 1.0);
    Minecraft.getMinecraft().getTextureManager().bindTexture(this.guilocation);
    this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
}

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

License:Open Source License

@Override
public void drawForeground() {
    GL11.glDisable(GL11.GL_LIGHTING);/*from   w w  w  .  j  a  v  a  2s .  c  o  m*/
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    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:de.sanandrew.mods.turretmod.client.render.tileentity.RenderItemTransmitter.java

License:Creative Commons License

private static void setupTooltipRenderer(Minecraft mc, TileEntityItemTransmitter te, float partTicks) {
    double playerPTX = mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * partTicks;
    double playerPTZ = mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * partTicks;
    Vec3 vecPos = Vec3.createVectorHelper(playerPTX - (te.xCoord + 0.5D), 0.0, playerPTZ - (te.zCoord + 0.5D));
    vecPos = vecPos.normalize();//from   w  ww  .jav  a 2s .  c  o m
    double angle = Math.toDegrees(Math.atan2(vecPos.zCoord, vecPos.xCoord));

    GL11.glDepthMask(false);
    GL11.glRotated(90, 0.0F, 1.0F, 0.0F);
    GL11.glRotated(angle, 0.0F, 1.0F, 0.0F);
    GL11.glTranslated(0.0F, -0.25F, 0.0F);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);

    GL11.glColor4d(1.0D, 1.0D, 1.0D, 0.75D + (float) SAPUtils.RNG.nextGaussian() * 0.02F);
}

From source file:de.sanandrew.mods.turretmod.client.render.tileentity.RenderItemTransmitter.java

License:Creative Commons License

private static void finishTooltipRenderer() {
    GL11.glDepthMask(true);
    GL11.glColor4d(1.0D, 1.0D, 1.0D, 1.0D);
    GL11.glEnable(GL11.GL_LIGHTING);
}

From source file:dk.philiphansen.craftech.inventory.GuiBlastFurnace.java

License:Open Source License

private void renderItems() {
    RenderItem renderItem = new RenderItem();
    renderItem.renderWithColor = false;/*from  w  w w.  ja  v a  2s.  c  o  m*/
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4d(0.6f, 0.6f, 0.6f, 0.7f);

    GL11.glPushMatrix();

    renderItem.renderItemIntoGUI(fontRendererObj, mc.renderEngine, new ItemStack(ModItems.itemIronDust), 62,
            17);
    renderItem.renderItemIntoGUI(fontRendererObj, mc.renderEngine, new ItemStack(ModItems.itemLimestoneDust),
            80, 17);
    renderItem.renderItemIntoGUI(fontRendererObj, mc.renderEngine, new ItemStack(ModItems.itemCokeDust), 98,
            17);

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

From source file:dk.philiphansen.craftech.inventory.GuiTechTable.java

License:Open Source License

/**
 * Render the items correlating to the crafting recipe, in the crafting matrix.
 *//*from  w  w  w  . j  a v  a  2 s  . c  om*/
private void renderItems() {
    if (techTable.getStackInSlot(10) != null) {
        ItemStack recipeItem = techTable.getStackInSlot(10);
        TechTableRecipe recipe = TechTableRecipes.getInstance().findMatchingRecipe(recipeItem);
        ItemStack[] input = recipe.getRecipeInput();

        RenderItem renderer = new RenderItem();
        renderer.renderWithColor = false;
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4d(0.6f, 0.6f, 0.6f, 0.7f);

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                ItemStack itemStack = input[i * 3 + j];

                GL11.glPushMatrix();

                if (itemStack != null) {
                    FontRenderer fontRenderer = itemStack.getItem().getFontRenderer(itemStack);

                    renderer.renderItemIntoGUI(fontRenderer, mc.renderEngine, itemStack, 50 + (18 * j),
                            17 + (i * 18));
                }

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

From source file:flash.display.DisplayObject.java

License:Open Source License

public final void JITB$renderDisplayObject() {
    if (!visible()) {
        return;//from  ww w  .j  a v  a2 s  .  co  m
    }

    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glPushMatrix();
    transform().matrix().JITB$toDoubleBuffer(modelViewMatrix);
    GL11.glLoadMatrix(modelViewMatrix);

    //GL11.glTranslated(x(), y(), 0.0);
    //GL11.glRotatef(_rotationRad, 0.0f, 0.0f, 1.0f);
    //GL11.glScaled(_scaleX, _scaleY, 1.0);
    GL11.glColor4d(_transform.colorTransform().redMultiplier, _transform.colorTransform().greenMultiplier,
            _transform.colorTransform().blueMultiplier, _transform.colorTransform().alphaMultiplier);
    final String blendMode = blendMode();
    boolean disableDepthTest = false;

    if (blendMode.equals(BlendMode.ADD)) {
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
        disableDepthTest = true;
    }

    try {
        JITB$render();
    } finally {
        if (disableDepthTest) {
            GL11.glDisable(GL11.GL_BLEND);
        }
        GL11.glPopMatrix();
    }
}