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:cn.academy.support.nei.FusorRecipeHandler.java

License:GNU General Public License

@Override
public void drawExtras(int recipe) {
    if (tick >= 50)
        tick = 0;/*from   w  w  w.j a  v a 2  s  .  co m*/
    GL11.glEnable(GL11.GL_BLEND);
    Resources.font().draw(String.valueOf(((IFCachedRecipe) arecipes.get(recipe)).liquid), 75, 11.5f,
            new FontOption(13, new Color(0xFF373737)));
    ShaderMono.instance().useProgram();
    GL11.glColor4f(55f / 151, 55f / 151, 55f / 151, 1);
    RenderUtils.loadTexture(new ResourceLocation("academy:textures/guis/progress/progress_fusor.png"));
    HudUtils.rect(62, 40.5f, 0, 0, 40d * (tick / 50d), 10, 126 * (tick / 50d), 30);
    GL20.glUseProgram(0);
}

From source file:cn.academy.support.nei.MetalFormerRecipeHandler.java

License:GNU General Public License

@Override
public void drawExtras(int recipe) {
    if (tick >= 50)
        tick = 0;/*www .  j a  va 2  s . co m*/
    ShaderMono.instance().useProgram();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glColor4f(55f / 151, 55f / 151, 55f / 151, 1);
    RenderUtils.loadTexture(((MFCachedRecipe) arecipes.get(recipe)).mode.texture);
    HudUtils.rect(73, 23, 0, 0, 18, 18, 48, 48);
    RenderUtils.loadTexture(new ResourceLocation("academy:textures/guis/progress/progress_metalformer.png"));
    HudUtils.rect(57, 41, 0, 0, 50d * (tick / 50d), 13, 114d * (tick / 50d), 30);
    GL20.glUseProgram(0);
}

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

License:Open Source License

@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    String currentPage = StatCollector
            .translateToLocal(RecipeWeapons.getPageDescription(tileEntity.currentPage));
    fontRendererObj.drawString(currentPage, 85 - fontRendererObj.getStringWidth(currentPage) / 2, 3, 0xff9843);
    super.drawGuiContainerForegroundLayer(par1, par2);
}

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  .ja va  2s.  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.block.crafter.GuiWeaponCrafter.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    if (!this.te.isLoaded)
        return;//w ww  .ja  va  2 s.co  m

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    RenderUtils.loadTexture(ClientProps.GUI_WEAPONCRAFTER_PATH);
    HudUtils.setTextureResolution(256, 256);
    HudUtils.setZLevel(zLevel);

    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;

    HudUtils.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);

    int dy = 0;
    if (te.iconType == CrafterIconType.NOMATERIAL)
        dy = 60;
    else if (te.iconType == CrafterIconType.CRAFTING)
        dy = 16;
    else
        dy = 38;
    drawTexturedModalRect(x + 160, y + 16, 232, dy, 8, 18);

    int height = te.heatForRendering * 64 / te.maxHeat;
    if (height > 0) {
        drawTexturedModalRect(x + 174, y + 78 - height, 232, 150 - height, 8, height);
    }
    if (te.heatRequired > 0) {
        if (te.currentRecipe != null) {
            height = te.currentRecipe.getHeatConsumed() * 64 / te.maxHeat;
            drawTexturedModalRect(x + 173, y + 77 - height, 201, 1, 6, 3);
        }
    }
    if (te.maxBurnTime != 0) {
        height = te.burnTimeLeft * 22 / te.maxBurnTime;
        if (height > 0)
            drawTexturedModalRect(x + 156, y + 78 - height, 211, 101 - height, 16, height);
    }

    this.drawElements(i, j);
}

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

License:Open Source License

@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    String guiName = StatCollector.translateToLocal(te.getInvName());
    this.fontRenderer.drawString(guiName, 7, 7, 0xdadada);
    super.drawGuiContainerForegroundLayer(par1, par2);
}

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();//from   w  w  w  .  j ava 2s . c  o m
    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 drawGuiContainerForegroundLayer(int par1, int par2) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    String currentPage = StatCollector.translateToLocal(RecipeWeapons.getDescription(tileEntity.page));
    fontRenderer.drawString(currentPage, 85 - fontRenderer.getStringWidth(currentPage) / 2, 3, 0xff9843);
    super.drawGuiContainerForegroundLayer(par1, par2);
}

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();//from ww  w  .jav a 2s. co 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 drawGuiContainerForegroundLayer(int par1, int par2) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    String guiName = CBCBlocks.genFire.getLocalizedName();
    this.fontRenderer.drawString(guiName, 7, 7, 0xff9944);
    super.drawGuiContainerForegroundLayer(par1, par2);
}