List of usage examples for org.lwjgl.opengl GL11 glLineWidth
public static void glLineWidth(@NativeType("GLfloat") float width)
From source file:shadowmage.ancient_warfare.client.render.RenderOverlayAdvanced.java
License:Open Source License
public static void renderRocketFlightPath(VehicleBase vehicle, EntityPlayer player, float partialTick) { GL11.glPushMatrix();//w w w .j av a2s. c o m GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4d(1, 1, 1, 0.6d); double x1 = vehicle.posX - player.posX; double y1 = vehicle.posY - player.posY; double z1 = vehicle.posZ - player.posZ; /** * vectors for a straight line */ double x2 = x1 - 20 * Trig.sinDegrees(vehicle.rotationYaw + partialTick * vehicle.moveHelper.getRotationSpeed()); double y2 = y1; double z2 = z1 - 20 * Trig.cosDegrees(vehicle.rotationYaw + partialTick * vehicle.moveHelper.getRotationSpeed()); GL11.glLineWidth(3f); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(x1, y1 + 0.12d, z1); GL11.glVertex3d(x2, y2 + 0.12d, z2); GL11.glEnd(); GL11.glLineWidth(4f); GL11.glColor4f(1.f, 0.4f, 0.4f, 0.4f); GL11.glBegin(GL11.GL_LINES); Pos3f offset = vehicle.getMissileOffset(); x2 = x1 + offset.x; y2 = y1 + offset.y; z2 = z1 + offset.z; double gravity = 9.81d * 0.05d * 0.05d; double speed = vehicle.localLaunchPower * 0.05d; double angle = 90 - vehicle.localTurretPitch - vehicle.rotationPitch; double yaw = vehicle.localTurretRotation + partialTick * vehicle.moveHelper.getRotationSpeed(); double vH = -Trig.sinDegrees((float) angle) * speed; double vY = Trig.cosDegrees((float) angle) * speed; double vX = Trig.sinDegrees((float) yaw) * vH; double vZ = Trig.cosDegrees((float) yaw) * vH; int rocketBurnTime = (int) (speed * 20.f * AmmoHwachaRocket.burnTimeFactor); if (vehicle.vehicleType.getMovementType() == VehicleMovementType.AIR1 || vehicle.vehicleType.getMovementType() == VehicleMovementType.AIR2) { vY += vehicle.motionY; vX += vehicle.motionX; vZ += vehicle.motionZ; y1 = -player.posY; } float xAcc = (float) (vX / speed) * AmmoHwachaRocket.accelerationFactor; ; float yAcc = (float) (vY / speed) * AmmoHwachaRocket.accelerationFactor; ; float zAcc = (float) (vZ / speed) * AmmoHwachaRocket.accelerationFactor; ; vX = xAcc; vY = yAcc; vZ = zAcc; while (y2 >= y1) { GL11.glVertex3d(x2, y2, z2); x2 += vX; z2 += vZ; y2 += vY; if (rocketBurnTime > 0) { rocketBurnTime--; vX += xAcc; vY += yAcc; vZ += zAcc; } else { vY -= gravity; } GL11.glVertex3d(x2, y2, z2); } GL11.glEnd(); GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_TEXTURE_2D); }
From source file:shadowmage.ancient_warfare.client.render.RenderOverlayAdvanced.java
License:Open Source License
public static void renderBatteringRamOverlay(VehicleBase vehicle, EntityPlayer player, float partialTick) { GL11.glPushMatrix();// ww w . j a va 2 s. c o m GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); // GL11.glDisable(GL11.GL_LIGHTING); // GL11.glDisable(GL11.GL_DEPTH_TEST); //GL11.glDepthMask(false); GL11.glColor4d(1, 1, 1, 0.6d); double x1 = vehicle.posX - player.posX; double y1 = vehicle.posY - player.posY; double z1 = vehicle.posZ - player.posZ; /** * vectors for a straight line */ double x2 = x1 - 20 * Trig.sinDegrees(vehicle.rotationYaw); double y2 = y1; double z2 = z1 - 20 * Trig.cosDegrees(vehicle.rotationYaw); GL11.glLineWidth(3f); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(x1, y1 + 0.12d, z1); GL11.glVertex3d(x2, y2 + 0.12d, z2); GL11.glEnd(); Pos3f offset = vehicle.getMissileOffset(); x2 = x1 + offset.x; y2 = y1 + offset.y; z2 = z1 + offset.z; float bx = (float) (vehicle.posX + offset.x); float by = (float) (vehicle.posY + offset.y); float bz = (float) (vehicle.posZ + offset.z); BlockPosition blockHit = new BlockPosition(bx, by, bz); AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(blockHit.x - 1, blockHit.y, blockHit.z, blockHit.x + 2, blockHit.y + 1, blockHit.z + 1); bb = AWRenderHelper.instance().adjustBBForPlayerPos(bb, player, partialTick); BoundingBoxRender.drawOutlinedBoundingBox(bb, 1.f, 0.2f, 0.2f); bb = resetBoundingBox(bb, blockHit.x, blockHit.y, blockHit.z - 1, blockHit.x + 1, blockHit.y + 1, blockHit.z + 2); bb = AWRenderHelper.instance().adjustBBForPlayerPos(bb, player, partialTick); BoundingBoxRender.drawOutlinedBoundingBox(bb, 1.f, 0.2f, 0.2f); bb = resetBoundingBox(bb, blockHit.x, blockHit.y - 1, blockHit.z, blockHit.x + 1, blockHit.y + 2, blockHit.z + 1); bb = AWRenderHelper.instance().adjustBBForPlayerPos(bb, player, partialTick); BoundingBoxRender.drawOutlinedBoundingBox(bb, 1.f, 0.2f, 0.2f); GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_TEXTURE_2D); }
From source file:shadowmage.ancient_warfare.client.render.RenderOverlayAdvanced.java
License:Open Source License
public static void renderNormalVehicleOverlay(VehicleBase vehicle, EntityPlayer player, float partialTick) { GL11.glPushMatrix();/*from w ww . j av a 2s . c o m*/ GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); // GL11.glDisable(GL11.GL_LIGHTING); // GL11.glDisable(GL11.GL_DEPTH_TEST); //GL11.glDepthMask(false); GL11.glColor4d(1, 1, 1, 0.6d); double x1 = vehicle.posX - player.posX; double y1 = vehicle.posY - player.posY; double z1 = vehicle.posZ - player.posZ; /** * vectors for a straight line */ double x2 = x1 - 20 * Trig.sinDegrees(vehicle.rotationYaw + partialTick * vehicle.moveHelper.getRotationSpeed()); double y2 = y1; double z2 = z1 - 20 * Trig.cosDegrees(vehicle.rotationYaw + partialTick * vehicle.moveHelper.getRotationSpeed()); GL11.glLineWidth(3f); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(x1, y1 + 0.12d, z1); GL11.glVertex3d(x2, y2 + 0.12d, z2); GL11.glEnd(); GL11.glLineWidth(4f); GL11.glColor4f(1.f, 0.4f, 0.4f, 0.4f); GL11.glBegin(GL11.GL_LINES); Pos3f offset = vehicle.getMissileOffset(); x2 = x1 + offset.x; y2 = y1 + offset.y; z2 = z1 + offset.z; double gravity = 9.81d * 0.05d * 0.05d; double speed = vehicle.localLaunchPower * 0.05d; double angle = 90 - vehicle.localTurretPitch - vehicle.rotationPitch; ; double yaw = vehicle.localTurretRotation + partialTick * vehicle.moveHelper.getRotationSpeed(); double vH = -Trig.sinDegrees((float) angle) * speed; double vY = Trig.cosDegrees((float) angle) * speed; double vX = Trig.sinDegrees((float) yaw) * vH; double vZ = Trig.cosDegrees((float) yaw) * vH; if (vehicle.vehicleType.getMovementType() == VehicleMovementType.AIR1 || vehicle.vehicleType.getMovementType() == VehicleMovementType.AIR2) { vY += vehicle.motionY; vX += vehicle.motionX; vZ += vehicle.motionZ; y1 = -player.posY; } while (y2 >= y1) { GL11.glVertex3d(x2, y2, z2); x2 += vX; z2 += vZ; y2 += vY; vY -= gravity; GL11.glVertex3d(x2, y2, z2); } GL11.glEnd(); GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_TEXTURE_2D); }
From source file:shadowmage.meim.client.gui.GuiModelEditor.java
License:Open Source License
private void renderGrid() { GL11.glDisable(GL11.GL_TEXTURE_2D);// w w w . j av a 2s . com GL11.glDisable(GL11.GL_LIGHTING); GL11.glLineWidth(2.f); if (gridDisplayList >= 0) { GL11.glCallList(gridDisplayList); } else { gridDisplayList = GL11.glGenLists(1); GL11.glNewList(gridDisplayList, GL11.GL_COMPILE_AND_EXECUTE); GL11.glColor4f(0.f, 0.f, 1.f, 1.f); for (int x = -5; x <= 5; x++) { GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3f(x, 0.f, -5.f); GL11.glVertex3f(x, 0.f, 5.f); GL11.glEnd(); } for (int z = -5; z <= 5; z++) { GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3f(-5.f, 0.f, z); GL11.glVertex3f(5.f, 0.f, z); GL11.glEnd(); } GL11.glColor4f(1.f, 1.f, 1.f, 1.f); GL11.glEndList(); } GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); }
From source file:sokobanMod.client.HandlerLevelPreviewRenderer.java
License:LGPL
public static void renderPulsingQuad() { time += 0.001;/*w w w . j a v a2 s . c o m*/ if (time > 2 * Math.PI) time = 0; float quadPosX = (float) Math.sin(time) * 0.2F; float quadPosY = (float) Math.cos(time) * 0.2F; GL11.glColor4f(colliding ? 1F : 0F, colliding ? 0F : 1F, 0F, 1F); GL11.glLineWidth(3.0F); GL11.glBegin(GL11.GL_LINES); // the lines around the whole level GL11.glVertex3f(-0.5F, 0.5F, 0F); GL11.glVertex3f(0.5F, 0.5F, 0F); GL11.glVertex3f(0.5F, -0.5F, 0F); GL11.glVertex3f(-0.5F, -0.5F, 0F); // draw the lines from the bigger quad's corner to the small quad's // corner float quadSize = 0.1F; GL11.glVertex3f(-0.5F, 0.5F, 0F); GL11.glVertex3f(-quadSize + quadPosX, quadSize + quadPosY, 0F); GL11.glVertex3f(0.5F, 0.5F, 0F); GL11.glVertex3f(quadSize + quadPosX, quadSize + quadPosY, 0F); GL11.glVertex3f(0.5F, -0.5F, 0F); GL11.glVertex3f(quadSize + quadPosX, -quadSize + quadPosY, 0F); GL11.glVertex3f(-0.5F, -0.5F, 0F); GL11.glVertex3f(-quadSize + quadPosX, -quadSize + quadPosY, 0F); GL11.glEnd(); // draw the quad inside the big quad GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3f(-quadSize + quadPosX, quadSize + quadPosY, 0F); GL11.glVertex3f(quadSize + quadPosX, quadSize + quadPosY, 0F); GL11.glVertex3f(quadSize + quadPosX, -quadSize + quadPosY, 0F); GL11.glVertex3f(-quadSize + quadPosX, -quadSize + quadPosY, 0F); GL11.glEnd(); }
From source file:steamcraft.common.lib.events.EventHandlerClient.java
License:Minecraft Mod Public
private void drawSelectionBox(EntityPlayer player, MovingObjectPosition mop, int i, ItemStack is, float partialTicks) { if ((i == 0) && (mop.typeOfHit == MovingObjectType.BLOCK)) { GL11.glEnable(GL11.GL_BLEND);//from ww w. j a v a 2 s . c o m GL11.glColor4f(0.0F, 1.0F, 0.0F, 1.0F); GL11.glLineWidth(3.5F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(false); float offset = 0.002F; Block block = player.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ); if (block != Blocks.air) { block.setBlockBoundsBasedOnState(player.worldObj, mop.blockX, mop.blockY, mop.blockZ); double dx = player.lastTickPosX + ((player.posX - player.lastTickPosX) * partialTicks); double dy = player.lastTickPosY + ((player.posY - player.lastTickPosY) * partialTicks); double dz = player.lastTickPosZ + ((player.posZ - player.lastTickPosZ) * partialTicks); this.drawOutlinedBoundingBox( block.getSelectedBoundingBoxFromPool(player.worldObj, mop.blockX, mop.blockY, mop.blockZ) .expand(offset, offset, offset).getOffsetBoundingBox(-dx, -dy, -dz)); } GL11.glDepthMask(true); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); } if ((i == 0) && (mop.typeOfHit == MovingObjectType.ENTITY)) { GL11.glEnable(GL11.GL_BLEND); GL11.glColor4f(0.0F, 1.0F, 0.0F, 1.0F); GL11.glLineWidth(3.5F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(false); float offset = 0.002F; Entity entity = mop.entityHit; if (entity != null) { entity.setPosition(entity.posX, entity.posY, entity.posZ); double dx = player.lastTickPosX + ((player.posX - player.lastTickPosX) * partialTicks); double dy = player.lastTickPosY + ((player.posY - player.lastTickPosY) * partialTicks); double dz = player.lastTickPosZ + ((player.posZ - player.lastTickPosZ) * partialTicks); this.drawOutlinedBoundingBox( entity.boundingBox.expand(offset, offset, offset).getOffsetBoundingBox(-dx, -dy, -dz)); } GL11.glDepthMask(true); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); } }
From source file:structuregenmod.handlers.SGTBlockHighlightHandler.java
License:Open Source License
/** * Helper method for 'highlightTile', not to be used in isolation *//* w w w . ja va2 s. com*/ private static final void drawQuad(float transparency) { GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glLineWidth(5.0F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(0F, 1F, 0F, transparency); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertex(-0.5F, 0.5F, 0F); tessellator.addVertex(0.5F, 0.5F, 0F); tessellator.addVertex(0.5F, -0.5F, 0F); tessellator.addVertex(-0.5F, -0.5F, 0F); tessellator.draw(); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_LIGHTING); }
From source file:tech.flatstone.appliedlogistics.common.blocks.misc.BlockCrank.java
License:Open Source License
@SubscribeEvent public void drawBlockHighlight(DrawBlockHighlightEvent event) { if (!(event.target.typeOfHit == MovingObjectType.BLOCK && ItemStack.areItemsEqual( new ItemStack(event.player.worldObj.getBlockState(event.target.getBlockPos()).getBlock()), new ItemStack(Blocks.BLOCK_MISC_CRANK.getBlock())))) return;//from www.j av a 2s .c om event.setCanceled(true); TileEntityCrank tileEntity = TileHelper.getTileEntity(event.player.worldObj, event.target.getBlockPos(), TileEntityCrank.class); RenderManager renderManager = Minecraft.getMinecraft().getRenderManager(); BlockPos posBlock = event.target.getBlockPos(); AxisAlignedBB crankTop = new AxisAlignedBB(7 / 16d, 10 / 16d, 2 / 16d, 9 / 16d, 12 / 16d, 14 / 16d) .offset(-0.5, -0.5, -0.5); AxisAlignedBB crankShaft = new AxisAlignedBB(7 / 16d, 0, 7 / 16d, 9 / 16d, 10 / 16d, 9 / 16d).offset(-0.5, -0.5, -0.5); GL11.glPushMatrix(); GlStateManager.translate(posBlock.getX() - renderManager.viewerPosX + 0.5, posBlock.getY() - renderManager.viewerPosY + 0.5, posBlock.getZ() - renderManager.viewerPosZ + 0.5); if (tileEntity.isRotating()) GlStateManager.rotate(tileEntity.getRotation() + 15 * event.partialTicks, 0, 1, 0); if (!tileEntity.isRotating()) GlStateManager.rotate(tileEntity.getRotation(), 0, 1, 0); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GlStateManager.color(0.0F, 0.0F, 0.0F, 0.4F); GL11.glLineWidth(2.0F); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.begin(3, DefaultVertexFormats.POSITION); worldrenderer.pos(crankShaft.maxX, crankShaft.maxY, crankShaft.maxZ).endVertex(); worldrenderer.pos(crankTop.maxX, crankTop.minY, crankTop.maxZ).endVertex(); worldrenderer.pos(crankTop.minX, crankTop.minY, crankTop.maxZ).endVertex(); worldrenderer.pos(crankShaft.minX, crankShaft.maxY, crankShaft.maxZ).endVertex(); tessellator.draw(); worldrenderer.begin(3, DefaultVertexFormats.POSITION); worldrenderer.pos(crankShaft.minX, crankShaft.maxY, crankShaft.minZ).endVertex(); worldrenderer.pos(crankTop.minX, crankTop.minY, crankTop.minZ).endVertex(); worldrenderer.pos(crankTop.maxX, crankTop.minY, crankTop.minZ).endVertex(); worldrenderer.pos(crankShaft.maxX, crankShaft.maxY, crankShaft.minZ).endVertex(); tessellator.draw(); worldrenderer.begin(3, DefaultVertexFormats.POSITION); worldrenderer.pos(crankTop.minX, crankTop.maxY, crankTop.minZ).endVertex(); worldrenderer.pos(crankTop.maxX, crankTop.maxY, crankTop.minZ).endVertex(); worldrenderer.pos(crankTop.maxX, crankTop.maxY, crankTop.maxZ).endVertex(); worldrenderer.pos(crankTop.minX, crankTop.maxY, crankTop.maxZ).endVertex(); worldrenderer.pos(crankTop.minX, crankTop.maxY, crankTop.minZ).endVertex(); tessellator.draw(); worldrenderer.begin(1, DefaultVertexFormats.POSITION); worldrenderer.pos(crankTop.minX, crankTop.minY, crankTop.minZ).endVertex(); worldrenderer.pos(crankTop.minX, crankTop.maxY, crankTop.minZ).endVertex(); worldrenderer.pos(crankTop.maxX, crankTop.minY, crankTop.minZ).endVertex(); worldrenderer.pos(crankTop.maxX, crankTop.maxY, crankTop.minZ).endVertex(); worldrenderer.pos(crankTop.maxX, crankTop.minY, crankTop.maxZ).endVertex(); worldrenderer.pos(crankTop.maxX, crankTop.maxY, crankTop.maxZ).endVertex(); worldrenderer.pos(crankTop.minX, crankTop.minY, crankTop.maxZ).endVertex(); worldrenderer.pos(crankTop.minX, crankTop.maxY, crankTop.maxZ).endVertex(); tessellator.draw(); worldrenderer.begin(3, DefaultVertexFormats.POSITION); worldrenderer.pos(crankShaft.minX, crankShaft.minY, crankShaft.minZ).endVertex(); worldrenderer.pos(crankShaft.maxX, crankShaft.minY, crankShaft.minZ).endVertex(); worldrenderer.pos(crankShaft.maxX, crankShaft.minY, crankShaft.maxZ).endVertex(); worldrenderer.pos(crankShaft.minX, crankShaft.minY, crankShaft.maxZ).endVertex(); worldrenderer.pos(crankShaft.minX, crankShaft.minY, crankShaft.minZ).endVertex(); tessellator.draw(); worldrenderer.begin(3, DefaultVertexFormats.POSITION); worldrenderer.pos(crankShaft.minX, crankShaft.maxY, crankShaft.minZ).endVertex(); worldrenderer.pos(crankShaft.maxX, crankShaft.maxY, crankShaft.minZ).endVertex(); tessellator.draw(); worldrenderer.begin(3, DefaultVertexFormats.POSITION); worldrenderer.pos(crankShaft.maxX, crankShaft.maxY, crankShaft.maxZ).endVertex(); worldrenderer.pos(crankShaft.minX, crankShaft.maxY, crankShaft.maxZ).endVertex(); tessellator.draw(); worldrenderer.begin(1, DefaultVertexFormats.POSITION); worldrenderer.pos(crankShaft.minX, crankShaft.minY, crankShaft.minZ).endVertex(); worldrenderer.pos(crankShaft.minX, crankShaft.maxY, crankShaft.minZ).endVertex(); worldrenderer.pos(crankShaft.maxX, crankShaft.minY, crankShaft.minZ).endVertex(); worldrenderer.pos(crankShaft.maxX, crankShaft.maxY, crankShaft.minZ).endVertex(); worldrenderer.pos(crankShaft.maxX, crankShaft.minY, crankShaft.maxZ).endVertex(); worldrenderer.pos(crankShaft.maxX, crankShaft.maxY, crankShaft.maxZ).endVertex(); worldrenderer.pos(crankShaft.minX, crankShaft.minY, crankShaft.maxZ).endVertex(); worldrenderer.pos(crankShaft.minX, crankShaft.maxY, crankShaft.maxZ).endVertex(); tessellator.draw(); GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); GL11.glPopMatrix(); }
From source file:thaumic.tinkerer.client.gui.kami.GuiWarpGateDestinations.java
License:Creative Commons License
@Override public void drawScreen(int par1, int par2, float par3) { drawDefaultBackground();//from ww w .j ava2s . c o m super.drawScreen(par1, par2, par3); tooltip.clear(); int gateX = warpGate.xCoord - x; int gateY = warpGate.zCoord - y; mc.renderEngine.bindTexture(TextureMap.locationItemsTexture); List<Object[]> coords = new ArrayList(); for (int i = 0; i < warpGate.getSizeInventory(); i++) { ItemStack stack = warpGate.getStackInSlot(i); if (stack != null && ItemSkyPearl.isAttuned(stack)) { int dim = ItemSkyPearl.getDim(stack); if (warpGate.getWorldObj().provider.dimensionId != dim) continue; int x = ItemSkyPearl.getX(stack); int y = ItemSkyPearl.getY(stack); int z = ItemSkyPearl.getZ(stack); if (y != -1) coords.add(new Object[] { x - this.x, z - this.y, stack, i }); } } GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1F, 1F, 1F, (float) ((Math.sin(ticks / 10D) + 1F) / 4F + 0.25F)); GL11.glLineWidth(2F); GL11.glDisable(GL11.GL_TEXTURE_2D); for (Object[] coords_ : coords) { int x = (Integer) coords_[0]; int y = (Integer) coords_[1]; GL11.glBegin(GL11.GL_LINES); GL11.glVertex2i(gateX, gateY); GL11.glVertex2i(x, y); GL11.glEnd(); } GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); fontRendererObj.drawStringWithShadow( EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("ttmisc.destinations"), 3, 40, 0xFFFFFF); GL11.glColor4f(1F, 1F, 1F, 1F); drawPearlAt(0, null, gateX, gateY, par1, par2); for (Object[] coords_ : coords) drawPearlAt((Integer) coords_[3], (ItemStack) coords_[2], (Integer) coords_[0], (Integer) coords_[1], par1, par2); if (!tooltip.isEmpty()) ClientHelper.renderTooltip(par1, par2, tooltip); drawCenteredString(fontRendererObj, StatCollector.translateToLocal("ttmisc.numberKeys"), width / 2, 5, 0xFFFFFF); drawCenteredString(fontRendererObj, StatCollector.translateToLocal("ttmisc.spaceToReset"), width / 2, 16, 0xFFFFFF); }
From source file:tk.ivybits.engine.gl.GL.java
License:Open Source License
public static void glLineWidth(float a) { GL11.glLineWidth(a); }