List of usage examples for org.lwjgl.opengl GL11 glColor4f
public static native void glColor4f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha);
From source file:com.minestellar.core.gui.widget.planets.GuiPlanet.java
License:Open Source License
@Override public void draw(int mousex, int mousey, float frame) { super.draw(mousex, mousey, frame); renderEngine.bindTexture(texture);//from ww w . j a v a 2s.c o m GL11.glColor4f(1, 1, 1, 1); if (isSelected()) { drawSelectedBox(); } drawTexturedModalRect(x, y, 0, 0, width / 2, height / 2); drawTexturedModalRect(x + width / 2, y, 4, 0, width / 2, height / 2); drawTexturedModalRect(x, y + height / 2, 0, 4, width / 2, height / 2); drawTexturedModalRect(x + width / 2, y + height / 2, 4, 4, width / 2, height / 2); }
From source file:com.minestellar.moon.world.SkyRendererMoon.java
License:Open Source License
@Override public void render(float partialTicks, WorldClient world, Minecraft mc) { WorldProviderMoon gcProvider = null; if (world.provider instanceof WorldProviderMoon) { gcProvider = (WorldProviderMoon) world.provider; }//from w w w . j a v a 2s. co m GL11.glDisable(GL11.GL_TEXTURE_2D); 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(); // SUN: 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(SkyRendererMoon.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); // EARTH: var12 = 50.0F; final float earthRotation = (float) (world.getSpawnPoint().posZ - mc.thePlayer.posZ) * 0.01F; GL11.glScalef(0.6F, 0.6F, 0.6F); GL11.glRotatef(earthRotation, 1.0F, 0.0F, 0.0F); GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(SkyRendererMoon.earthTexture); world.getMoonPhase(); var23.startDrawingQuads(); var23.addVertexWithUV(-var12, -400.0D, var12, 0, 1); var23.addVertexWithUV(var12, -400.0D, var12, 1, 1); var23.addVertexWithUV(var12, -400.0D, -var12, 1, 0); var23.addVertexWithUV(-var12, -400.0D, -var12, 0, 0); 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); }
From source file:com.monocly.monocraft.client.gui.EnhancedCraftingGui.java
License:LGPL
/** * Draw the background layer for the GuiContainer (everything behind the * items)// ww w . j a v a2 s.c om */ @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(Textures.GUI_PORTABLE_CRAFTING); int var5 = (width - xSize) / 2; int var6 = (height - ySize) / 2; this.drawTexturedModalRect(var5, var6, 0, 0, xSize, ySize); if (!shadowCraftingContainer.canPlayerCraft) { int outputX = var5 + 123, outputY = var6 + 34, slotSize = 18; this.drawRect(outputX, outputY, outputX + slotSize, outputY + slotSize, -65536); } }
From source file:com.mrcrayfish.furniture.gui.GuiBedsideCabinet.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(gui); int var5 = (this.width - this.xSize) / 2; int var6 = (this.height - this.ySize) / 2; this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); }
From source file:com.mrcrayfish.furniture.gui.GuiBin.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(gui); int l = (width - xSize) / 2; int i1 = (height - ySize) / 2; this.drawTexturedModalRect(l, i1, 0, 0, xSize, ySize); }
From source file:com.mrcrayfish.furniture.gui.GuiCabinet.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(gui); int l = (width - xSize) / 2; int i1 = (height - ySize) / 2; this.drawTexturedModalRect(l, i1, 0, 0, xSize, ySize); }
From source file:com.mrcrayfish.furniture.gui.GuiComputer.java
License:Open Source License
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(gui); int l = (width - xSize) / 2; int i1 = (height - ySize) / 2; this.drawTexturedModalRect(l, i1 - 10, 0, 0, xSize, ySize + 21); }
From source file:com.mrcrayfish.furniture.gui.GuiDishwasher.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(gui); int l = (width - xSize) / 2; int i1 = (height - ySize) / 2; this.drawTexturedModalRect(l, i1, 0, 0, xSize, ySize); if (tileEntityDishwasher.isWashing()) { int superMode = tileEntityDishwasher.superMode ? 20 : 50; int percent = (tileEntityDishwasher.progress % superMode) * 55 / superMode; drawTexturedModalRect((l + 39), (i1 + 94) - percent, 176, 55 - percent, 9, percent); }// w w w . j a va 2 s . co m int percent = tileEntityDishwasher.timeRemaining * 55 / 5000; int superMode = tileEntityDishwasher.superMode ? 14 : 0; drawTexturedModalRect((l + 129), (i1 + 94) - percent, 185 + superMode, 0, 7, percent); drawTexturedModalRect((l + 129), (i1 + 39), 192, 0, 7, 55); if (tileEntityDishwasher.isWashing()) { button_start.displayString = "Stop"; drawColour(l + 37, i1 + 9, 11, 11, 49475); } else { button_start.displayString = "Start"; drawColour(l + 37, i1 + 9, 11, 11, 16711680); } }
From source file:com.mrcrayfish.furniture.gui.GuiEnvelope.java
License:Open Source License
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(gui); int l = (width - xSize) / 2; int i1 = (height - ySize) / 2; this.drawTexturedModalRect(l, i1, 0, 0, xSize, ySize); }
From source file:com.mrcrayfish.furniture.gui.GuiFreezer.java
License:Open Source License
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(gui); int l = (width - xSize) / 2; int i1 = (height - ySize) / 2; this.drawTexturedModalRect(l, i1, 0, 0, xSize, ySize); int var7; if (this.FreezerInventory.isFreezing()) { var7 = this.FreezerInventory.getFreezeTimeRemainingScaled(12); drawTexturedModalRect(l + 15, (i1 + 40) - var7, 176, 12 - var7, 14, var7 + 2); }//from ww w . j av a 2 s .co m var7 = this.FreezerInventory.getCoolProgressScaled(24); drawTexturedModalRect(l + 86, i1 + 27, 176, 14, var7 + 1, 16); }