Example usage for org.lwjgl.opengl GL11 glColor3f

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

Introduction

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

Prototype

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

Source Link

Document

Float version of #glColor3b Color3b

Usage

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

License:Open Source License

@Override
public void drawForeground(int mouseX, int mouseY) {
    mouseX -= posX;// w  w  w .ja v  a  2 s  .  com
    mouseY -= posY;

    GL11.glPushMatrix();
    GL11.glTranslatef(this.posX, this.posY, 0);
    GL11.glColor3f(1, 1, 1);
    for (int i = getElements().size(); i-- > 0;) {
        MOElementBase c = getElements().get(i);
        if (c.isVisible())
            c.drawForeground(mouseX, mouseY);
    }
    GL11.glPopMatrix();
}

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

License:Open Source License

@Override
public void drawBackground(int mouseX, int mouseY, float gameTicks) {
    GL11.glColor3f(1, 1, 1);
    gui.bindTexture(BG);/*from   ww w  .  j  av  a 2s.c o  m*/
    gui.drawSizedTexturedModalRect(this.posX, this.posY, 0, 0, 22, 22, 22, 22);
}

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

License:Open Source License

@Override
public void drawBackground(int mouseX, int mouseY, float gameTicks) {
    GL11.glColor3f(1, 1, 1);
    gui.bindTexture(BG);/* w  w w .  ja  v  a 2s.c om*/
    gui.drawSizedTexturedModalRect(posX, posY, 0, 5 * indication, sizeX, sizeY, texW, texH);
}

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

License:Open Source License

@Override
public void drawBackground(int mouseX, int mouseY, float gameTicks) {
    GL11.glPushMatrix();/*from   ww  w . j a v a2  s  . c o  m*/
    GL11.glTranslatef(posX, posY, 0);

    gui.bindTexture(texture);
    this.drawTexturedModalRect(0, 0, 0, 0, 117, 47);
    Color color = new Color(191, 228, 230);

    random.setSeed(seed);
    int progress = MathHelper.floor_float(this.progress * 26);

    int marginsTop = 8;
    int marginsLeft = 7;
    int maxHeight = 32;

    for (int i = 0; i < 26; i++) {
        float newValue = 0;

        if (i < progress) {
            double noiseValue = ((MOMathHelper.noise(0, 0.05f * i, Math.pow(seed * 100, 2)) + 1.0) / 2.0);
            double contrastFactor = 2;
            noiseValue = contrastFactor * (noiseValue - 0.5) + 0.5;
            noiseValue = Math.pow(Math.min(noiseValue, 1), 2);
            noiseValue = noiseValue * 0.8 + random.nextDouble() * 0.2;

            newValue = (float) noiseValue;
            int height = Math.round(values[i] * maxHeight);
            int x1 = marginsLeft + i * 4;
            int y1 = maxHeight + marginsTop;
            int x2 = x1 + 2;
            int y2 = maxHeight - height + marginsTop;

            gui.drawSizedRect(x1, y1, x2, y2, color.getColor());
            gui.drawSizedRect(x1, y2 - 1, x2, y2 - 2, color.getColor());
        } else {
            newValue = 0;
        }

        values[i] = MOMathHelper.Lerp(values[i], newValue, 0.05f);
    }

    GL11.glPopMatrix();
    GL11.glColor3f(1, 1, 1);
}

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

License:Open Source License

@Override
public void DrawElement(int i, int x, int y, int selectedLineColor, int selectedTextColor, boolean selected,
        boolean BG) {
    GL11.glColor3f(1, 1, 1);

    if (selected) {
        if (i == 0)
            MOElementButton.NORMAL_TEXTURE.render(x, y, getElementWidth(i), getElementHeight(i));
        else {/*from w ww . j  av a 2 s  . c  o  m*/
            MOElementButton.HOVER_TEXTURE.render(x, y, getElementWidth(i), getElementHeight(i));

            MOElementButton.HOVER_TEXTURE_DARK.render(x + 60, y + (getElementHeight(i) / 2) - 2, 50,
                    (getElementHeight(i) / 2) - 4);
            Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("top", x + 76, y + 24, 0xFFFFFF);
        }

        MOElementButton.HOVER_TEXTURE_DARK.render(x + 6, y + (getElementHeight(i) / 2) - 2, 50,
                (getElementHeight(i) / 2) - 4);
        Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("remove", x + 13, y + 24, 0xFFFFFF);
    } else {
        if (i == 0)
            MOElementButton.NORMAL_TEXTURE.render(x, y, getElementWidth(i), getElementHeight(i));
        else
            MOElementButton.HOVER_TEXTURE_DARK.render(x, y, getElementWidth(i), getElementHeight(i));
    }

    MatterNetworkTask task = taskQueue.getAt(i);
    Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(task.getName(), x + 8, y + 7, 0xFFFFFF);
}

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

License:Open Source License

@Override
public void drawBackground(int mouseX, int mouseY, float gameTicks) {
    GL11.glColor3f(1, 1, 1);
    RenderUtils.bindTexture(texture);//from  w w w .ja va2s . c  o m
    gui.drawSizedTexturedModalRect(posX, posY, 0, 0, 22, 22, 22, 22);
}

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

License:Open Source License

protected void ResetColor() {
    GL11.glColor3f(1, 1, 1);
}

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

License:Open Source License

@Override
public void drawForeground(int mouseX, int mouseY) {
    if (icon != null) {
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        ClientProxy.holoIcons.bindSheet();
        if (iconColor != null)
            RenderUtils.applyColor(iconColor);
        else//from   w  ww .  j a v  a2  s.  c o  m
            GL11.glColor3f(1, 1, 1);
        ClientProxy.holoIcons.renderIcon(icon, posX - icon.getOriginalWidth() / 2 + sizeX / 2,
                posY - icon.getOriginalHeight() / 2 + sizeY / 2);
    }
}

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

License:Open Source License

@Override
public void drawBackground(int mouseX, int mouseY, float ticks) {
    if (openable) {
        if (isOpen) {
            GL11.glColor3f(1, 1, 1);
            BACKGROUND_TEXTURE.render(posX, posY, 37, sizeY);
            button.setPosition(32, 0);/*from  w w  w  .  ja  v a2s. c  o m*/
        } else {
            button.setPosition(0, 0);
        }
    }

    super.drawBackground(mouseX, mouseY, ticks);
}

From source file:mattparks.mods.starcraft.callisto.client.SCCallistoSkyProvider.java

License:LGPL

@Override
public void render(float partialTicks, WorldClient world, Minecraft mc) {
    SCCallistoWorldProvider gcProvider = null;

    if (world.provider instanceof SCCallistoWorldProvider) {
        gcProvider = (SCCallistoWorldProvider) world.provider;
    }/*w ww.  ja  v a  2 s  . c  o  m*/

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    final Vec3 var2 = this.getCustomSkyColor();
    float var3 = (float) var2.xCoord * (1 - world.getStarBrightness(partialTicks) * 2);
    float var4 = (float) var2.yCoord * (1 - world.getStarBrightness(partialTicks) * 2);
    float var5 = (float) var2.zCoord * (1 - world.getStarBrightness(partialTicks) * 2);
    float var8;

    if (mc.gameSettings.anaglyph) {
        final float var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F;
        final float var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F;
        var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F;
        var3 = var6;
        var4 = var7;
        var5 = var8;
    }

    GL11.glColor3f(1, 1, 1);
    final Tessellator var23 = Tessellator.instance;
    GL11.glDepthMask(false);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glColor3f(0, 0, 0);
    GL11.glCallList(this.glSkyList);
    GL11.glDisable(GL11.GL_FOG);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderHelper.disableStandardItemLighting();
    float var10;
    float var11;
    float var12;

    float var20 = 0;

    if (gcProvider != null) {
        var20 = gcProvider.getStarBrightness(partialTicks);
    }

    if (var20 > 0.0F) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, var20);
        GL11.glCallList(this.starGLCallList);
    }

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
    GL11.glPushMatrix();

    GL11.glPopMatrix();

    GL11.glPushMatrix();

    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 5F);
    GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
    var12 = 30.0F;
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(SCCallistoSkyProvider.sunTexture);
    var23.startDrawingQuads();
    var23.addVertexWithUV(-var12, 150.0D, -var12, 0.0D, 0.0D);
    var23.addVertexWithUV(var12, 150.0D, -var12, 1.0D, 0.0D);
    var23.addVertexWithUV(var12, 150.0D, var12, 1.0D, 1.0D);
    var23.addVertexWithUV(-var12, 150.0D, var12, 0.0D, 1.0D);
    var23.draw();

    GL11.glPopMatrix();

    GL11.glPushMatrix();

    GL11.glDisable(GL11.GL_BLEND);

    // JUPITER:
    var12 = 10.0F;
    final float jupiterRotation = (float) (world.getSpawnPoint().posZ - mc.thePlayer.posZ) * 0.01F;
    GL11.glRotatef(-180.0F, 0.0F, 1.0F, 0.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 5F);
    GL11.glRotatef(world.getCelestialAngle(partialTicks) * 40.0F, 1.0F, 0.0F, 0.0F);
    var12 = 30.0F;
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(SCCallistoSkyProvider.jupiterTexture);
    var23.startDrawingQuads();
    var23.addVertexWithUV(-var12, 155.0D, -var12, 0.0D, 0.0D);
    var23.addVertexWithUV(var12, 155.0D, -var12, 1.0D, 0.0D);
    var23.addVertexWithUV(var12, 155.0D, var12, 1.0D, 1.0D);
    var23.addVertexWithUV(-var12, 155.0D, var12, 0.0D, 1.0D);
    var23.draw();

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glPopMatrix();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor3f(0.0F, 0.0F, 0.0F);
    final double var25 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon();

    if (var25 < 0.0D) {
        GL11.glPushMatrix();
        GL11.glTranslatef(0.0F, 12.0F, 0.0F);
        GL11.glCallList(this.glSkyList2);
        GL11.glPopMatrix();
        var10 = 1.0F;
        var11 = -((float) (var25 + 65.0D));
        var12 = -var10;
        var23.startDrawingQuads();
        var23.setColorRGBA_I(0, 255);
        var23.addVertex(-var10, var11, var10);
        var23.addVertex(var10, var11, var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(var10, var12, -var10);
        var23.addVertex(var10, var11, -var10);
        var23.addVertex(-var10, var11, -var10);
        var23.addVertex(var10, var12, -var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(var10, var11, var10);
        var23.addVertex(var10, var11, -var10);
        var23.addVertex(-var10, var11, -var10);
        var23.addVertex(-var10, var11, var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(-var10, var12, -var10);
        var23.addVertex(-var10, var12, var10);
        var23.addVertex(var10, var12, var10);
        var23.addVertex(var10, var12, -var10);
        var23.draw();
    }

    GL11.glColor3f(70F / 256F, 70F / 256F, 70F / 256F);

    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, -((float) (var25 - 16.0D)), 0.0F);
    GL11.glCallList(this.glSkyList2);
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(true);
}