Example usage for org.lwjgl.opengl GL11 glColor4f

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

Introduction

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

Prototype

public static native void glColor4f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green,
        @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha);

Source Link

Document

Float version of #glColor4b Color4b

Usage

From source file:buildcraft.energy.GuiCombustionEngine.java

License:Minecraft Mod Public

@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
    int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(i);// w  w  w. j ava2  s .c  om
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(j, k, 0, 0, xSize, ySize);

    TileEngine engine = (TileEngine) tile;
    EngineIron engineIron = ((EngineIron) engine.engine);

    if (engine.getScaledBurnTime(58) > 0)
        displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58), engineIron.liquidId);

    if (engineIron.getScaledCoolant(58) > 0)
        displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58), engineIron.coolantId);
}

From source file:buildcraft.factory.gui.GuiAutoCrafting.java

License:Minecraft Mod Public

@Override
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(TEXTURE);
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    if (bench.progress > 0) {
        int progress = bench.getProgressScaled(23);
        drawTexturedModalRect(x + 89, y + 45, 176, 0, progress + 1, 12);
    }/*from  w w  w .  j  av  a2 s .c  o  m*/
}

From source file:buildcraft.factory.gui.GuiHopper.java

License:Minecraft Mod Public

@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(TEXTURE);
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
}

From source file:buildcraft.factory.gui.GuiRefinery.java

License:Minecraft Mod Public

@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(TEXTURE);
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(j, k, 0, 0, xSize, ySize);

    updateSlots();/*from   w  ww. j ava  2 s  .  c o  m*/
    drawBackgroundSlots();
}

From source file:buildcraft.factory.GuiAutoCrafting.java

License:Minecraft Mod Public

@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
    int i = mc.renderEngine.getTexture("/gui/crafting.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(i);/* ww  w  . jav  a 2s  . com*/
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
}

From source file:buildcraft.factory.GuiRefinery.java

License:Minecraft Mod Public

@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
    int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/refinery_filter.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(i);//from  w ww. j a  va  2 s .  co  m
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(j, k, 0, 0, xSize, ySize);

    updateSlots();
    drawBackgroundSlots();
}

From source file:buildcraft.lib.gui.button.GuiBetterButton.java

License:Minecraft Mod Public

@Override
public void drawButton(Minecraft minecraft, int mouseX, int mouseY) {
    if (!visible) {
        return;//from ww  w.j a va  2 s  . c  o m
    }

    FontRenderer fontrenderer = minecraft.fontRendererObj;
    bindButtonTextures(minecraft);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    int xOffset = texture.getX();
    int yOffset = texture.getY();
    int h = texture.getHeight();
    int w = texture.getWidth();
    boolean mouseOver = isMouseOver();
    int hoverState = getHoverState(mouseOver);
    drawTexturedModalRect(xPosition, yPosition, xOffset, yOffset + hoverState * h, width / 2, h);
    drawTexturedModalRect(xPosition + width / 2, yPosition, xOffset + w - width / 2, yOffset + hoverState * h,
            width / 2, h);
    mouseDragged(minecraft, mouseX, mouseY);
    drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (h - 8) / 2,
            getTextColor(mouseOver));
}

From source file:buildcraft.robotics.render.RenderRobot.java

License:Minecraft Mod Public

private void doRenderRobot(float factor, TextureManager texManager, float storagePercent, boolean isAsleep) {
    box.render(factor);//  ww  w  . j a va 2s  .  c o m

    if (!isAsleep) {
        float lastBrightnessX = OpenGlHelper.lastBrightnessX;
        float lastBrightnessY = OpenGlHelper.lastBrightnessY;

        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);

        GL11.glColor4f(1.0F, 1.0F, 1.0F, storagePercent);
        texManager.bindTexture(overlay_red);
        box.render(factor);

        GL11.glDisable(GL11.GL_BLEND);

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        texManager.bindTexture(overlay_cyan);
        box.render(factor);

        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();

        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastBrightnessX, lastBrightnessY);
    }

}

From source file:buildcraft.silicon.gui.GuiAdvancedCraftingTable.java

License:Minecraft Mod Public

@Override
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
    super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(TEXTURE);
    int cornerX = (width - xSize) / 2;
    int cornerY = (height - ySize) / 2;
    if (workbench.getEnergy() > 0) {
        int progress = workbench.getProgressScaled(24);
        drawTexturedModalRect(cornerX + 93, cornerY + 32, 176, 0, progress + 1, 18);
    }//from   w  ww . ja v  a 2  s.  c o  m
}

From source file:buildcraft.silicon.gui.GuiAdvancedCraftingTableOld.java

License:Minecraft Mod Public

@Override
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
    super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(TEXTURE);
    if (workbench.getEnergy() > 0) {
        int progress = workbench.getProgressScaled(24);
        drawTexturedModalRect(guiLeft + 93, guiTop + 32, 176, 0, progress + 1, 18);
    }//  w w  w  . j a v a  2s.c  o  m
    if (workbench.getControlMode() == Mode.Off) {
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
        drawTexturedModalRect(guiLeft + 93, guiTop + 16, CoreIconProvider.TURNED_OFF.getSprite(), 16, 16);
    }
}