List of usage examples for org.lwjgl.opengl GL11 glEnable
public static void glEnable(@NativeType("GLenum") int target)
From source file:buildcraft.transport.render.PipeRendererTESR.java
License:Minecraft Mod Public
private void renderSolids(Pipe<PipeTransportItems> pipe, double x, double y, double z) { GL11.glPushMatrix();/*from w ww.j a v a2 s .c o m*/ GL11.glDisable(2896 /* GL_LIGHTING */); float light = pipe.container.getWorldObj().getLightBrightness(pipe.container.xCoord, pipe.container.yCoord, pipe.container.zCoord); int count = 0; for (TravelingItem item : pipe.transport.items) { if (count >= MAX_ITEMS_TO_RENDER) { break; } doRenderItem(item, x + item.xCoord - pipe.container.xCoord, y + item.yCoord - pipe.container.yCoord, z + item.zCoord - pipe.container.zCoord, light, item.color); count++; } GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); }
From source file:buildcraft.transport.render.RenderPipe.java
License:Minecraft Mod Public
private void renderPower(Pipe pipe, double x, double y, double z) { PipeTransportPower pow = (PipeTransportPower) pipe.transport; GL11.glPushMatrix();/*www.j a v a 2s .com*/ GL11.glDisable(2896 /* GL_LIGHTING */); ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_BLOCKS, 0); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); int[] displayList = pow.overload ? displayPowerListOverload : displayPowerList; for (int i = 0; i < 6; ++i) { GL11.glPushMatrix(); GL11.glRotatef(angleY[i], 0, 1, 0); GL11.glRotatef(angleZ[i], 0, 0, 1); if (pow.displayPower[i] >= 1.0) { short stage = pow.displayPower[i]; if (stage < displayList.length) { GL11.glCallList(displayList[stage]); } else { GL11.glCallList(displayList[displayList.length - 1]); } } GL11.glPopMatrix(); } GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); }
From source file:buildcraft.transport.render.RenderPipe.java
License:Minecraft Mod Public
private void renderLiquids(Pipe pipe, double x, double y, double z) { PipeTransportLiquids liq = (PipeTransportLiquids) pipe.transport; GL11.glPushMatrix();//from w w w .ja v a 2 s . c o m GL11.glDisable(2896 /* GL_LIGHTING */); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); // sides boolean sides = false, above = false; for (int i = 0; i < 6; ++i) { // ILiquidTank tank = liq.getTanks()[i]; // LiquidStack liquid = tank.getLiquid(); LiquidStack liquid = liq.renderCache[i]; // int amount = liquid != null ? liquid.amount : 0; // int amount = liquid != null ? liq.renderAmmount[i] : 0; if (liquid != null && liquid.amount > 0) { DisplayLiquidList d = getListFromBuffer(liquid, pipe.worldObj); if (d == null) { continue; } int stage = (int) ((float) liquid.amount / (float) (liq.getCapacity()) * (LIQUID_STAGES - 1)); GL11.glPushMatrix(); int list = 0; switch (ForgeDirection.VALID_DIRECTIONS[i]) { case UP: above = true; list = d.sideVertical[stage]; break; case DOWN: GL11.glTranslatef(0, -0.75F, 0); list = d.sideVertical[stage]; break; case EAST: case WEST: case SOUTH: case NORTH: sides = true; GL11.glRotatef(angleY[i], 0, 1, 0); GL11.glRotatef(angleZ[i], 0, 0, 1); list = d.sideHorizontal[stage]; break; default: } GL11.glCallList(list); GL11.glPopMatrix(); } } // CENTER // ILiquidTank tank = liq.getTanks()[ForgeDirection.Unknown.ordinal()]; // LiquidStack liquid = tank.getLiquid(); LiquidStack liquid = liq.renderCache[ForgeDirection.UNKNOWN.ordinal()]; // int amount = liquid != null ? liquid.amount : 0; // int amount = liquid != null ? liq.renderAmmount[ForgeDirection.Unknown.ordinal()] : 0; if (liquid != null && liquid.amount > 0) { // DisplayLiquidList d = getListFromBuffer(liq.getTanks()[ForgeDirection.Unknown.ordinal()].getLiquid(), pipe.worldObj); DisplayLiquidList d = getListFromBuffer(liquid, pipe.worldObj); if (d != null) { int stage = (int) ((float) liquid.amount / (float) (liq.getCapacity()) * (LIQUID_STAGES - 1)); if (above) { GL11.glCallList(d.centerVertical[stage]); } if (!above || sides) { GL11.glCallList(d.centerHorizontal[stage]); } } } GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); }
From source file:buildcraft.transport.render.RenderPipe.java
License:Minecraft Mod Public
private void renderSolids(Pipe pipe, double x, double y, double z) { GL11.glPushMatrix();/* w ww.ja v a 2 s . c o m*/ GL11.glDisable(2896 /* GL_LIGHTING */); float light = pipe.worldObj.getLightBrightness(pipe.xCoord, pipe.yCoord, pipe.zCoord); int count = 0; for (EntityData data : ((PipeTransportItems) pipe.transport).travelingEntities.values()) { if (count >= MAX_ITEMS_TO_RENDER) { break; } doRenderItem(data.item, x + data.item.getPosition().x - pipe.xCoord, y + data.item.getPosition().y - pipe.yCoord, z + data.item.getPosition().z - pipe.zCoord, light); count++; } GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); }
From source file:buildcraft.transport.RenderPipe.java
License:Minecraft Mod Public
private void renderPower(Pipe pipe, double x, double y, double z) { PipeTransportPower pow = (PipeTransportPower) pipe.transport; GL11.glPushMatrix();// w w w . j av a 2 s.c o m GL11.glDisable(2896 /* GL_LIGHTING */); MinecraftForgeClient.bindTexture(DefaultProps.TEXTURE_BLOCKS); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); for (int i = 0; i < 6; ++i) { GL11.glPushMatrix(); GL11.glRotatef(angleY[i], 0, 1, 0); GL11.glRotatef(angleZ[i], 0, 0, 1); if (pow.displayPower[i] >= 1.0) { int stage = 0; for (; stage < displayPowerStages; ++stage) if (displayPowerLimits[stage] > pow.displayPower[i]) break; if (stage < displayPowerList.length) GL11.glCallList(displayPowerList[stage]); else GL11.glCallList(displayPowerList[displayPowerList.length - 1]); } GL11.glPopMatrix(); } GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); }
From source file:buildcraft.transport.RenderPipe.java
License:Minecraft Mod Public
private void renderLiquids(Pipe pipe, double x, double y, double z) { PipeTransportLiquids liq = (PipeTransportLiquids) pipe.transport; GL11.glPushMatrix();//from w w w. j a v a2 s . c om GL11.glDisable(2896 /* GL_LIGHTING */); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); // sides boolean sides = false, above = false; for (int i = 0; i < 6; ++i) { //ILiquidTank tank = liq.getTanks()[i]; //LiquidStack liquid = tank.getLiquid(); LiquidStack liquid = liq.renderCache[i]; //int amount = liquid != null ? liquid.amount : 0; //int amount = liquid != null ? liq.renderAmmount[i] : 0; if (liquid != null && liquid.amount > 0) { DisplayLiquidList d = getListFromBuffer(liquid, pipe.worldObj); if (d == null) continue; int stage = (int) ((float) liquid.amount / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); GL11.glPushMatrix(); int list = 0; switch (Orientations.values()[i]) { case YPos: above = true; list = d.sideVertical[stage]; break; case YNeg: GL11.glTranslatef(0, -0.75F, 0); list = d.sideVertical[stage]; break; case XPos: case XNeg: case ZPos: case ZNeg: sides = true; GL11.glRotatef(angleY[i], 0, 1, 0); GL11.glRotatef(angleZ[i], 0, 0, 1); list = d.sideHorizontal[stage]; break; } GL11.glCallList(list); GL11.glPopMatrix(); } } // CENTER // ILiquidTank tank = liq.getTanks()[Orientations.Unknown.ordinal()]; // LiquidStack liquid = tank.getLiquid(); LiquidStack liquid = liq.renderCache[Orientations.Unknown.ordinal()]; //int amount = liquid != null ? liquid.amount : 0; //int amount = liquid != null ? liq.renderAmmount[Orientations.Unknown.ordinal()] : 0; if (liquid != null && liquid.amount > 0) { //DisplayLiquidList d = getListFromBuffer(liq.getTanks()[Orientations.Unknown.ordinal()].getLiquid(), pipe.worldObj); DisplayLiquidList d = getListFromBuffer(liquid, pipe.worldObj); if (d != null) { int stage = (int) ((float) liquid.amount / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); if (above) GL11.glCallList(d.centerVertical[stage]); if (!above || sides) GL11.glCallList(d.centerHorizontal[stage]); } } GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); }
From source file:buildcraft.transport.RenderPipe.java
License:Minecraft Mod Public
private void renderSolids(Pipe pipe, double x, double y, double z) { GL11.glPushMatrix();/*from w ww . jav a 2s . c o m*/ GL11.glDisable(2896 /* GL_LIGHTING */); float light = pipe.worldObj.getLightBrightness(pipe.xCoord, pipe.yCoord, pipe.zCoord); int count = 0; for (EntityData data : ((PipeTransportItems) pipe.transport).travelingEntities.values()) { if (count >= numItemsToRender) break; doRenderItem(data.item, x + data.item.getPosition().x - pipe.xCoord, y + data.item.getPosition().y - pipe.yCoord, z + data.item.getPosition().z - pipe.zCoord, light); count++; } GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); }
From source file:buildcraft.transport.RenderPipe.java
License:Minecraft Mod Public
public void doRenderItem(IPipedItem entityitem, double d, double d1, double d2, float f1) { if (entityitem == null || entityitem.getItemStack() == null) return;/*from w ww.j a v a 2 s .co m*/ ItemStack itemstack = entityitem.getItemStack(); random.setSeed(187L); GL11.glPushMatrix(); byte quantity = 1; if (entityitem.getItemStack().stackSize > 1) quantity = 2; GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glEnable(32826 /* GL_RESCALE_NORMAL_EXT */); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, ItemRenderType.ENTITY); if (customRenderer != null) { GL11.glTranslatef(0, 0.25F, 0); // BC SPECIFIC loadTexture("/terrain.png"); ForgeHooksClient.overrideTexture(itemstack.getItem()); float f4 = 0.25F; f4 = 0.5F; GL11.glScalef(f4, f4, f4); for (int j = 0; j < quantity; j++) { GL11.glPushMatrix(); if (j > 0) { float f5 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; float f7 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; float f9 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; GL11.glTranslatef(f5, f7, f9); } RenderPipe.dummyEntityItem.item = itemstack; customRenderer.renderItem(ItemRenderType.ENTITY, itemstack, renderBlocks, RenderPipe.dummyEntityItem); GL11.glPopMatrix(); } } else if (itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) { GL11.glTranslatef(0, 0.25F, 0); // BC SPECIFIC loadTexture("/terrain.png"); ForgeHooksClient.overrideTexture(Block.blocksList[itemstack.itemID]); float f4 = 0.25F; int j = Block.blocksList[itemstack.itemID].getRenderType(); if (j == 1 || j == 19 || j == 12 || j == 2) f4 = 0.5F; GL11.glScalef(f4, f4, f4); for (int k = 0; k < quantity; k++) { GL11.glPushMatrix(); if (k > 0) { float f6 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; float f9 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; float f11 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; GL11.glTranslatef(f6, f9, f11); } float f7 = 1.0F; renderBlocks.renderBlockAsItem(Block.blocksList[itemstack.itemID], itemstack.getItemDamage(), f7); GL11.glPopMatrix(); } } else { GL11.glTranslatef(0, 0.10F, 0); // BC SPECIFIC if (itemstack.getItem().requiresMultipleRenderPasses()) { GL11.glScalef(0.5F, 0.5F, 0.5F); this.loadTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[itemstack.itemID])); for (int i = 0; i <= 1; ++i) { int iconIndex = itemstack.getItem().getIconFromDamageForRenderPass(itemstack.getItemDamage(), i); float scale = 1.0F; if (true) { int var17 = Item.itemsList[itemstack.itemID].getColorFromDamage(itemstack.getItemDamage(), i); float var18 = (var17 >> 16 & 255) / 255.0F; float var19 = (var17 >> 8 & 255) / 255.0F; float var20 = (var17 & 255) / 255.0F; GL11.glColor4f(var18 * scale, var19 * scale, var20 * scale, 1.0F); } this.drawItem(iconIndex, quantity); } } else { GL11.glScalef(0.5F, 0.5F, 0.5F); int i = itemstack.getIconIndex(); if (itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null) { loadTexture("/terrain.png"); ForgeHooksClient.overrideTexture(Block.blocksList[itemstack.itemID]); } else { loadTexture("/gui/items.png"); ForgeHooksClient.overrideTexture(Item.itemsList[itemstack.itemID]); } drawItem(i, quantity); } } GL11.glDisable(32826 /* GL_RESCALE_NORMAL_EXT */); GL11.glPopMatrix(); }
From source file:buildcraftAdditions.client.models.ModelKineticDuster.java
License:GNU General Public License
@Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { this.cube.render(f5); this.shape11_2.render(f5); GL11.glPushMatrix();//from w w w .j a va 2 s . c o m GL11.glTranslatef(this.shape24_3.offsetX, this.shape24_3.offsetY, this.shape24_3.offsetZ); GL11.glTranslatef(this.shape24_3.rotationPointX * f5, this.shape24_3.rotationPointY * f5, this.shape24_3.rotationPointZ * f5); GL11.glScaled(1.0D, 6.0D, 14.0D); GL11.glTranslatef(-this.shape24_3.offsetX, -this.shape24_3.offsetY, -this.shape24_3.offsetZ); GL11.glTranslatef(-this.shape24_3.rotationPointX * f5, -this.shape24_3.rotationPointY * f5, -this.shape24_3.rotationPointZ * f5); 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, 0.2F); this.shape24_3.render(f5); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); this.shape11_7.render(f5); this.shape11_5.render(f5); this.shape11_1.render(f5); GL11.glPushMatrix(); GL11.glTranslatef(this.shape24_1.offsetX, this.shape24_1.offsetY, this.shape24_1.offsetZ); GL11.glTranslatef(this.shape24_1.rotationPointX * f5, this.shape24_1.rotationPointY * f5, this.shape24_1.rotationPointZ * f5); GL11.glScaled(1.0D, 6.0D, 14.0D); GL11.glTranslatef(-this.shape24_1.offsetX, -this.shape24_1.offsetY, -this.shape24_1.offsetZ); GL11.glTranslatef(-this.shape24_1.rotationPointX * f5, -this.shape24_1.rotationPointY * f5, -this.shape24_1.rotationPointZ * f5); 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, 0.2F); this.shape24_1.render(f5); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslatef(this.shape24_2.offsetX, this.shape24_2.offsetY, this.shape24_2.offsetZ); GL11.glTranslatef(this.shape24_2.rotationPointX * f5, this.shape24_2.rotationPointY * f5, this.shape24_2.rotationPointZ * f5); GL11.glScaled(1.0D, 6.0D, 14.0D); GL11.glTranslatef(-this.shape24_2.offsetX, -this.shape24_2.offsetY, -this.shape24_2.offsetZ); GL11.glTranslatef(-this.shape24_2.rotationPointX * f5, -this.shape24_2.rotationPointY * f5, -this.shape24_2.rotationPointZ * f5); 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, 0.2F); this.shape24_2.render(f5); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslatef(this.shape24_5.offsetX, this.shape24_5.offsetY, this.shape24_5.offsetZ); GL11.glTranslatef(this.shape24_5.rotationPointX * f5, this.shape24_5.rotationPointY * f5, this.shape24_5.rotationPointZ * f5); GL11.glScaled(14.0D, 1.0D, 14.0D); GL11.glTranslatef(-this.shape24_5.offsetX, -this.shape24_5.offsetY, -this.shape24_5.offsetZ); GL11.glTranslatef(-this.shape24_5.rotationPointX * f5, -this.shape24_5.rotationPointY * f5, -this.shape24_5.rotationPointZ * f5); 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, 0.2F); this.shape24_5.render(f5); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); this.shape11_4.render(f5); this.shape11_3.render(f5); this.shape11_6.render(f5); this.shape11.render(f5); GL11.glPushMatrix(); GL11.glTranslatef(this.shape24.offsetX, this.shape24.offsetY, this.shape24.offsetZ); GL11.glTranslatef(this.shape24.rotationPointX * f5, this.shape24.rotationPointY * f5, this.shape24.rotationPointZ * f5); GL11.glScaled(14.0D, 6.0D, 1.0D); GL11.glTranslatef(-this.shape24.offsetX, -this.shape24.offsetY, -this.shape24.offsetZ); GL11.glTranslatef(-this.shape24.rotationPointX * f5, -this.shape24.rotationPointY * f5, -this.shape24.rotationPointZ * f5); 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, 0.2F); this.shape24.render(f5); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslatef(this.shape24_4.offsetX, this.shape24_4.offsetY, this.shape24_4.offsetZ); GL11.glTranslatef(this.shape24_4.rotationPointX * f5, this.shape24_4.rotationPointY * f5, this.shape24_4.rotationPointZ * f5); GL11.glScaled(14.0D, 6.0D, 1.0D); GL11.glTranslatef(-this.shape24_4.offsetX, -this.shape24_4.offsetY, -this.shape24_4.offsetZ); GL11.glTranslatef(-this.shape24_4.rotationPointX * f5, -this.shape24_4.rotationPointY * f5, -this.shape24_4.rotationPointZ * f5); 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, 0.2F); this.shape24_4.render(f5); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); }
From source file:buildcraftAdditions.client.render.BucketItemRenderer.java
License:GNU General Public License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if (item == null || item.getItem() == null || !(item.getItem() instanceof ItemBucketBCA)) return;/*from w w w . j a v a 2s.com*/ ItemBucketBCA bucket = (ItemBucketBCA) item.getItem(); Fluid fluid = null; boolean gaseous = false; if (bucket.getFluid() != null) { fluid = bucket.getFluid().getFluid(); if (fluid != null && (fluid.isGaseous() || fluid.getDensity() < 0)) gaseous = true; } IIcon overlay = bucket.getOverlay(); IIcon bucketIcon = Items.bucket.getIconFromDamage(0); GL11.glPushMatrix(); GL11.glEnable(GL11.GL_ALPHA_TEST); if (type.equals(ItemRenderType.EQUIPPED)) { GL11.glRotated(180, 0, 0, 1); GL11.glTranslated(-1, -1, 0); } else if (type.equals(ItemRenderType.ENTITY)) { GL11.glRotated(180, 0, 0, 1); GL11.glRotated(90, 0, 1, 0); GL11.glTranslated(-0.5, -0.9, 0); if (item.isOnItemFrame()) { GL11.glTranslated(0.075, 0.475, 0); GL11.glScaled(0.85, 0.85, 0.85); } } else if (type.equals(ItemRenderType.EQUIPPED_FIRST_PERSON)) { GL11.glTranslated(1, 1, 0); GL11.glRotated(180, 0, 0, 1); } if (fluid != null) { Minecraft.getMinecraft().renderEngine.bindTexture(RenderUtils.MC_ITEM_SHEET); renderMask(overlay, fluid.getIcon(), type, gaseous); } Minecraft.getMinecraft().renderEngine.bindTexture(RenderUtils.MC_ITEM_SHEET); if (!type.equals(ItemRenderType.INVENTORY)) { if (gaseous) ItemRenderer.renderItemIn2D(Tessellator.instance, bucketIcon.getMaxU(), bucketIcon.getMinV(), bucketIcon.getMinU(), bucketIcon.getMaxV(), bucketIcon.getIconWidth(), bucketIcon.getIconHeight(), 0.0625F); else ItemRenderer.renderItemIn2D(Tessellator.instance, bucketIcon.getMinU(), bucketIcon.getMaxV(), bucketIcon.getMaxU(), bucketIcon.getMinV(), bucketIcon.getIconWidth(), bucketIcon.getIconHeight(), 0.0625F); } else renderIcon(bucketIcon, 0, gaseous); GL11.glColor4f(1, 1, 1, 1); GL11.glPopMatrix(); }