@Override
    public void draw(int startX, int startY) {
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      RenderHelper.enableGUIStandardItemLighting();
      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

      ItemStack output = getOutputStack();
      if (output != null) manager.gui.drawItemStack(output, startX + xPos, startY + yPos);
      // RenderHelper.disableStandardItemLighting();

      GL11.glDisable(GL11.GL_DEPTH_TEST);

      if (worktable.getMemory().isLocked(slotNumber)) {
        manager.gui.setZLevel(110f);
        Proxies.common.bindTexture(SpriteSheet.ITEMS);
        manager.gui.drawTexturedModelRectFromIcon(
            startX + xPos,
            startY + yPos,
            TextureManager.getInstance().getDefault("slots/locked"),
            16,
            16);
        manager.gui.setZLevel(0f);
      }

      GL11.glPopAttrib();
    }
 @SubscribeEvent(priority = EventPriority.LOWEST)
 @Optional.Method(modid = Mods.OpenComputers)
 public void onRobotRender(RobotRenderEvent e) {
   if (!rendering) {
     return;
   }
   if (e.mountPoints == null || e.mountPoints.length < 2) {
     return;
   }
   MountPoint mountPoint = e.mountPoints[1];
   GL11.glPushMatrix();
   GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
   GL11.glTranslatef(0.5f, 0.5f, 0.5f);
   GL11.glColor3f(color.r, color.g, color.b);
   float degrees = 360 - ((time % 160) / 160F * 360F);
   Minecraft.getMinecraft().getTextureManager().bindTexture(modelRadar);
   GL11.glDisable(GL11.GL_CULL_FACE);
   GL11.glRotatef(180, 1, 0, 0);
   GL11.glRotatef(
       mountPoint.rotation.getW(),
       mountPoint.rotation.getX(),
       mountPoint.rotation.getY(),
       mountPoint.rotation.getZ());
   GL11.glTranslatef(0F, -0.8F, 0F);
   GL11.glTranslatef(mountPoint.offset.getX(), mountPoint.offset.getY(), mountPoint.offset.getZ());
   GL11.glScalef(0.3f, 0.3f, 0.3f);
   GL11.glPushMatrix();
   radarModel.render(Math.max(degrees, 0));
   GL11.glPopMatrix();
   GL11.glPopMatrix();
   GL11.glPopAttrib();
 }
Exemple #3
0
  public static void renderSphere(Vector3f center, float radius, Vector3f colour) {
    glPushAttrib(GL_ENABLE_BIT);
    {
      glDisable(GL_TEXTURE_2D); // Texture 2D is disabled so no textures are incorporated
      glDisable(GL_LIGHTING); // Lighting is turned off for 2D
      glBegin(GL_LINE_LOOP);
      {
        glColor3f(colour.x, colour.y, colour.z);
        for (int i = 0; i < 360; i++) {
          double degInRad = i * Math.PI / 180;
          glVertex3f(
              (float) (center.x + Math.cos(degInRad) * radius),
              (float) (center.y + Math.sin(degInRad) * radius),
              center.z);
        }
      }
      glEnd();

      glBegin(GL_LINE_LOOP);
      {
        glColor3f(colour.x, colour.y, colour.z);
        for (int i = 0; i < 360; i++) {
          double degInRad = i * Math.PI / 180;
          glVertex3f(
              center.x,
              (float) (center.y + Math.cos(degInRad) * radius),
              (float) (center.z + Math.sin(degInRad) * radius));
        }
      }
      glEnd();
    }
    glPopAttrib();
  }
  @Override
  public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    GL11.glPushMatrix();
    GL11.glTranslated(-tileentity.xCoord, -tileentity.yCoord, -tileentity.zCoord);
    GL11.glTranslated(x, y, z);

    if (tileentity instanceof IBoxesProvider) {
      for (Box b : ((IBoxesProvider) tileentity).getBoxes()) {
        if (b.isVisible) {
          RenderBox.doRender(
              TileEntityRendererDispatcher.instance.field_147553_e, getTexture(b.kind), b);
        }
      }
    } else if (tileentity instanceof IBoxProvider) {
      Box b = ((IBoxProvider) tileentity).getBox();

      if (b.isVisible) {
        RenderBox.doRender(
            TileEntityRendererDispatcher.instance.field_147553_e, getTexture(b.kind), b);
      }
    }

    GL11.glPopMatrix();

    GL11.glPopAttrib();
    GL11.glPopMatrix();
  }
Exemple #5
0
 protected void setupGLState() {
   GL11.glPushAttrib(
       GL11.GL_ENABLE_BIT
           | GL11.GL_TRANSFORM_BIT
           | GL11.GL_HINT_BIT
           | GL11.GL_COLOR_BUFFER_BIT
           | GL11.GL_SCISSOR_BIT
           | GL11.GL_LINE_BIT
           | GL11.GL_TEXTURE_BIT);
   GL11.glMatrixMode(GL11.GL_PROJECTION);
   GL11.glPushMatrix();
   GL11.glLoadIdentity();
   GL11.glOrtho(0, width, height, 0, -1.0, 1.0);
   GL11.glMatrixMode(GL11.GL_MODELVIEW);
   GL11.glPushMatrix();
   GL11.glLoadIdentity();
   GL11.glEnable(GL11.GL_TEXTURE_2D);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glEnable(GL11.GL_LINE_SMOOTH);
   GL11.glDisable(GL11.GL_DEPTH_TEST);
   GL11.glDisable(GL11.GL_LIGHTING);
   GL11.glDisable(GL11.GL_SCISSOR_TEST);
   GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
   GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST);
 }
  @Override
  protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    ReikaTextureHelper.bindFontTexture();

    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    ReikaGuiAPI.instance.drawCenteredStringNoShadow(
        fontRendererObj,
        StatCollector.translateToLocal("chroma.routerfilter"),
        xSize / 2,
        5,
        0xffffff);

    for (int i = 0; i < 9; i++) {
      ItemRule ir = tile.getFilter(i);
      if (ir != null) {
        int x = 8 + i * 18;
        int y = 33;
        ReikaGuiAPI.instance.drawItemStack(
            itemRender, fontRendererObj, ReikaItemHelper.getSizedItemStack(ir.getItem(), 1), x, y);
        GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        ReikaGuiAPI.instance.drawRectFrame(x - 1, y - 1, 18, 18, 0xff000000 | ir.mode.color);
        GL11.glPopAttrib();
      }
    }
  }
  @Optional.Method(modid = Mods.OpenComputers)
  public void render(ItemStack stack, MountPoint mountPoint, Robot robot, float pt) {
    if (!isUpgrade(stack)) {
      return;
    }

    Minecraft mc = Minecraft.getMinecraft();
    TextureManager tm = mc.getTextureManager();

    switch (stack.getItemDamage()) {
      case 1:
        {
          tm.bindTexture(upgradeChatBox);
          drawSimpleBlock(mountPoint, 0, true);
          break;
        }
      case 2:
        {
          if (mountPoint.name.equals(MountPointName.TopLeft)
              || mountPoint.name.equals(MountPointName.TopRight)) {
            float degrees =
                robot.shouldAnimate()
                    ? ((robot.world().getTotalWorldTime() + (robot.hashCode() ^ 0xFF)) % 160 + pt)
                        / 160F
                        * 360F
                    : 0F;
            if (mountPoint.name.equals(MountPointName.TopRight)) {
              degrees = 360 - degrees;
            }
            GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
            tm.bindTexture(modelRadar);
            GL11.glDisable(GL11.GL_CULL_FACE);
            GL11.glRotatef(180, 1, 0, 0);
            GL11.glRotatef(
                mountPoint.rotation.getW(),
                mountPoint.rotation.getX(),
                mountPoint.rotation.getY(),
                mountPoint.rotation.getZ());
            GL11.glTranslatef(0F, -0.8F, 0F);
            GL11.glTranslatef(
                mountPoint.offset.getX(), mountPoint.offset.getY(), mountPoint.offset.getZ());
            GL11.glScalef(0.3f, 0.3f, 0.3f);
            GL11.glPushMatrix();
            radarModel.render(Math.max(degrees, 0));
            GL11.glPopMatrix();
            GL11.glPopAttrib();
          } else {
            tm.bindTexture(upgradeRadar);
            drawSimpleBlock(mountPoint, 0, true);
          }
          break;
        }
      case 5:
        {
          tm.bindTexture(beepCard);
          drawSimpleBlock(mountPoint, 0, true);
          break;
        }
    }
  }
  @Override
  public void drawScreen(int x, int y, float par3) {
    super.drawScreen(x, y, par3);

    MerchantRecipeList recipes = this.villager.getRecipes(this.mc.thePlayer);
    if ((recipes != null) && !(recipes.isEmpty())) {
      int xCenter = (this.width - this.xSize) / 2;
      int yCenter = (this.height - this.ySize) / 2;

      MerchantRecipe recipe = (MerchantRecipe) recipes.get(this.currentRecipeIndex);

      ItemStack[] slot = new ItemStack[3];
      slot[0] = recipe.getItemToBuy();
      slot[1] = recipe.getSecondItemToBuy();
      slot[2] = recipe.getItemToSell();

      GL11.glPushMatrix();
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);

      RenderHelper.enableGUIStandardItemLighting();

      GL11.glEnable(GL12.GL_RESCALE_NORMAL);

      itemRender.zLevel = 100;
      itemRender.renderItemAndEffectIntoGUI(
          this.fontRendererObj, this.mc.renderEngine, slot[0], xCenter + 36, yCenter + 24);
      itemRender.renderItemOverlayIntoGUI(
          this.fontRendererObj, this.mc.renderEngine, slot[0], xCenter + 36, yCenter + 24);

      if (slot[1] != null) {
        itemRender.renderItemAndEffectIntoGUI(
            this.fontRendererObj, this.mc.renderEngine, slot[1], xCenter + 62, yCenter + 24);
        itemRender.renderItemOverlayIntoGUI(
            this.fontRendererObj, this.mc.renderEngine, slot[1], xCenter + 62, yCenter + 24);
      }

      itemRender.renderItemAndEffectIntoGUI(
          this.fontRendererObj, this.mc.renderEngine, slot[2], xCenter + 120, yCenter + 24);
      itemRender.renderItemOverlayIntoGUI(
          this.fontRendererObj, this.mc.renderEngine, slot[2], xCenter + 120, yCenter + 24);

      itemRender.zLevel = 0;

      GL11.glDisable(GL11.GL_LIGHTING);

      if (this.func_146978_c(36, 24, 16, 16, x, y)) {
        this.renderToolTip(slot[0], x, y);
      } else if ((slot[1] != null) && this.func_146978_c(62, 24, 16, 16, x, y)) {
        this.renderToolTip(slot[1], x, y);
      } else if (this.func_146978_c(120, 24, 16, 16, x, y)) {
        this.renderToolTip(slot[2], x, y);
      }

      RenderHelper.enableStandardItemLighting();

      GL11.glPopAttrib();
      GL11.glPopMatrix();
    }
  }
Exemple #9
0
 @Override
 protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
   glPushAttrib(GL_BLEND);
   glEnable(GL_BLEND);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   super.drawGuiContainerBackgroundLayer(f, i, j);
   glPopAttrib();
 }
 private void push() {
   GL11.glPushMatrix();
   GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
   GL11.glEnable(GL11.GL_CULL_FACE);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glDisable(GL11.GL_LIGHTING);
   GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
 }
Exemple #11
0
  public void update(EnemyControl e) {
    glPopAttrib();

    fftLogUpdate();

    glPushAttrib(GL_ALL_ATTRIB_BITS);

    genEnemies(Constants.VIEW_WIDTH / 2, Constants.VIEW_HEIGHT / 2, e);
  }
Exemple #12
0
  public void drawLineBox(int x0, int y0, int x1, int y1, boolean stippled) {
    //    glPushMatrix();
    glPushAttrib(GL_ENABLE_BIT);
    glPushAttrib(GL_POLYGON_BIT);
    glPushAttrib(GL_CURRENT_BIT);
    glDisable(GL_LIGHTING);
    if (stippled) {
      glLineStipple(1, (short) 0xAAAA);
      glEnable(GL_LINE_STIPPLE);
    }
    glDisable(GL_TEXTURE_2D);
    glColor3d(1.0, 1.0, 1.0); // White is nice

    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
    // GL11.glRecti(iMouseX, iMouseY, mouseX , mouseY);
    glRecti(x0, y0, x1, y1);

    glPopAttrib();
    glPopAttrib();
    glPopAttrib();
  }
    @Override
    public void draw(int startX, int startY) {
      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      RenderHelper.enableGUIStandardItemLighting();
      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

      manager.gui.drawItemStack(BOOK, startX + xPos, startY + yPos);

      GL11.glPopAttrib();
    }
Exemple #14
0
  public View(int iFramesPerSecond) {
    this.createDisplay();
    this.setupOpenGl();

    glPushAttrib(GL_ALL_ATTRIB_BITS);

    Fonts.initialize();

    fps = iFramesPerSecond;
    fullScr = true;
    if (!Constants.allowFullScr) fullScr = false;
    sM = null;
  }
  @Override
  protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glPushAttrib(GL11.GL_CURRENT_BIT);
    GL11.glColor4f(1, 1, 1, 1);
    this.mc.renderEngine.bindTexture(guiTrading);

    int xCenter = (this.width - this.xSize) / 2;
    int yCenter = (this.height - this.ySize) / 2;

    this.drawTexturedModalRect(xCenter, yCenter, 0, 0, this.xSize, this.ySize);

    GL11.glPopAttrib();
  }
 @Override
 public void renderTileEntityAt(
     TileEntity tile, double par2, double par4, double par6, float par8) {
   TileEntityBiomePainter te = (TileEntityBiomePainter) tile;
   GL11.glPushMatrix();
   GL11.glTranslated(par2, par4, par6);
   this.renderModel(te, outerFrame, this.getTextureFolder() + "biomepainterouter.png");
   this.renderInnerFrame(te, par8);
   GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
   for (int i = 0; i < 6; i++) this.renderGlow(te, par8, i);
   GL11.glPopAttrib();
   GL11.glPopMatrix();
 }
Exemple #17
0
  public void onDraw(double elapsedMillis, GameArena arena, Level gameLevel) {
    glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_ENABLE_BIT);
    glDisable(GL_DEPTH_TEST);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    drawPlayerIcons(gameLevel.getPlayer(), elapsedMillis);

    drawLabels(elapsedMillis, arena, gameLevel);

    GLHelper.checkAndThrow();

    glPopAttrib();
  }
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {

    GL11.glPushAttrib(GL11.GL_TEXTURE_BIT);
    Tessellator t = Tessellator.instance;
    t.draw();
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, YC_Constants.TreeCrystalTextureID);
    GL11.glPushMatrix();
    double t1 = 0, t2 = 0, t3 = 0;
    if (!YC_Options.EnableOptifineCompability) {
      ResetTranslation(x, y, z);
      GL11.glTranslatef(x, y, z);
      t1 = Tessellator.instance.xOffset;
      t2 = Tessellator.instance.yOffset;
      t3 = Tessellator.instance.zOffset;
      Tessellator.instance.setTranslation(0, 0, 0);
    } else {
      GL11.glTranslated(
          x + Tessellator.instance.xOffset,
          y + Tessellator.instance.yOffset,
          z + Tessellator.instance.zOffset);
    }
    GL11.glColor4f(1f, 1f, 1f, 1f);
    // {
    int md = world.getBlockMetadata(x, y, z);
    GL11.glTranslatef(0.5f, 0.5f, 0.5f);
    GL11.glRotatef(GetRotationXFromMD(md), 1, 0, 0);
    GL11.glRotatef(GetRotationZFromMD(md), 0, 0, 1);
    GL11.glTranslatef(-0.5f, -0.5f, +0.5f);
    YC_Mod.m_TreeCrystal.DrawWOTranslation();
    if (YC_Options.RenderContourSecondPass) {
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D, Minecraft.getMinecraft().renderEngine.getTexture("/YC/blank.png"));
      GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_LINE);
      GL11.glColor3f(0f, 0f, 0f);
      YC_Mod.m_TreeCrystal.DrawWOTranslation();
      GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_FILL);
    }
    // }
    if (!YC_Options.EnableOptifineCompability) {
      Tessellator.instance.setTranslation(t1, t2, t3);
    }
    GL11.glPopMatrix();
    GL11.glColor4f(1f, 1f, 1f, 1f);
    GL11.glPopAttrib();

    t.startDrawingQuads();

    return true;
  }
  protected void drawItem(final int x, final int y, final ItemStack is) {
    this.zLevel = 100.0F;
    itemRender.zLevel = 100.0F;

    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    RenderHelper.enableGUIStandardItemLighting();
    itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.renderEngine, is, x, y);
    GL11.glPopAttrib();

    itemRender.zLevel = 0.0F;
    this.zLevel = 0.0F;
  }
Exemple #20
0
  public Chat(Client c) {
    log = new ArrayList<String>();
    messageToSend = new StringBuffer();

    client = c;

    // First message on screen lets client know where they've connected
    log.add("Client connected to " + client.host + " using port " + client.port);

    // Create font
    Font font = new Font("Courier New", Font.PLAIN, 13);
    glPushAttrib(GL_TEXTURE_BIT);
    chatFont = new TrueTypeFont(font, true);
    glPopAttrib();
  }
 public void renderVehicle(
     EntityShip entity, double x, double y, double z, float yaw, float pitch) {
   GL11.glPushAttrib(8256);
   RenderHelper.disableStandardItemLighting();
   GL11.glPushMatrix();
   GL11.glTranslatef((float) x, (float) y, (float) z);
   GL11.glRotatef(yaw, 0.0F, 1.0F, 0.0F);
   float fx = entity.getShipChunk().getCenterX();
   float fz = entity.getShipChunk().getCenterZ();
   GL11.glTranslatef(-fx, (float) (-entity.getShipChunk().minY()), -fz);
   float f4 = 0.75F;
   this.func_110777_b(entity);
   entity.getShipChunk().renderer.render(0.0F);
   GL11.glPopMatrix();
   GL11.glPopAttrib();
 }
  private void renderCursor(float x, float y, Context c) {
    if (blinkTime < blinkPeriod / 2) {
      GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
      GL14.glBlendFuncSeparate(
          GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ZERO, GL11.GL_ZERO, GL11.GL_ZERO);
      GL20.glBlendEquationSeparate(GL14.GL_FUNC_ADD, GL14.GL_FUNC_ADD);

      c.resetColor();
      c.pushTransform();
      c.appendTransform(Matrix.translation(x, y, 0));
      font.getSprite(getCursorChar()).render(c);
      c.popTransform();

      GL11.glPopAttrib();
    }
  }
Exemple #23
0
  /** Renders the chatbox and messages */
  public void render() {
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    // Push currently enabled flags
    glPushAttrib(GL_ENABLE_BIT);
    {
      glDisable(GL_DEPTH_TEST); // Depth is disabled to prevent clipping
      glDisable(GL_TEXTURE_2D); // Texture 2D is disabled so no textures are incorporated
      glDisable(GL_LIGHTING); // Lighting is turned off for 2D
      glEnable(GL_BLEND); // Blend is needed for transparency with game

      drawChatBox(); // Draw the container for chat box
      getMessageFromClient(); // Poll for message from client receiver
      drawText(); // Draw the text to the screen
    }
    glPopAttrib();
  }
 @Override
 public final void renderTileEntityAt(
     TileEntity tile, double par2, double par4, double par6, float par8) {
   GL11.glPushMatrix();
   GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
   GL11.glDisable(GL11.GL_ALPHA_TEST);
   GL11.glDisable(GL11.GL_LIGHTING);
   GL11.glDisable(GL11.GL_CULL_FACE);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glDepthMask(false);
   GL11.glColor4f(1, 1, 1, 1);
   GL11.glTranslated(par2, par4, par6);
   if (MinecraftForgeClient.getRenderPass() == 1 || !tile.hasWorldObj())
     this.renderCore((TileEntityLocusPoint) tile, par2, par4, par6, par8);
   this.doOtherRendering((TileEntityLocusPoint) tile, par8);
   GL11.glPopAttrib();
   GL11.glPopMatrix();
 }
Exemple #25
0
 public static void setupView(int width, int height) {
   glPopAttrib();
   glPushAttrib(GL_ENABLE_BIT);
   glEnable(GL_TEXTURE_2D);
   glEnable(GL_BLEND);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   setupLighting();
   glClearDepth(1D);
   glEnable(GL_DEPTH_TEST);
   glEnable(GL_CULL_FACE);
   glDepthFunc(GL_LEQUAL);
   glViewport(0, 0, width, height);
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   gluPerspective(60F, (float) width / height, 0.1F, 1000F);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
 }
    void bind() {
      EXTFramebufferObject.glBindFramebufferEXT(
          EXTFramebufferObject.GL_FRAMEBUFFER_EXT, frameBuffer);

      GL11.glPushAttrib(glAttributes);
      GL11.glViewport(x0, y0, width, height);
      GL11.glEnable(GL11.GL_SCISSOR_TEST);
      GL11.glScissor(x0, y0, width, height);

      lightmapEnabled = false;
      if (gl13Supported) {
        GL13.glActiveTexture(GL13.GL_TEXTURE1);
        lightmapEnabled = GL11.glIsEnabled(GL11.GL_TEXTURE_2D);
        if (lightmapEnabled) {
          GL11.glDisable(GL11.GL_TEXTURE_2D);
        }
        GL13.glActiveTexture(GL13.GL_TEXTURE0);
      }
      GL11.glEnable(GL11.GL_TEXTURE_2D);
      GL11.glDisable(GL11.GL_DEPTH_TEST);
      GLAPI.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
      GL11.glDisable(GL11.GL_LIGHTING);
      GL11.glEnable(GL11.GL_ALPHA_TEST);
      GLAPI.glAlphaFunc(GL11.GL_GREATER, 0.01f);
      if (useGL13) {
        GL11.glDisable(GL13.GL_MULTISAMPLE);
      }

      GLAPI.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
      GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);

      GL11.glMatrixMode(GL11.GL_PROJECTION);
      GL11.glPushMatrix();
      GL11.glLoadIdentity();
      GL11.glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f);

      GL11.glMatrixMode(GL11.GL_MODELVIEW);
      GL11.glPushMatrix();
      GL11.glLoadIdentity();
    }
 @Override
 public void renderOverlay(ScaledResolution resolution) {
   int xPos = Config.isBuffBarLeft ? 2 : resolution.getScaledWidth() - (ICON_SPACING + 2);
   int yPos = 2;
   int offset = 0;
   int increment =
       Config.isBuffBarHorizontal && !Config.isBuffBarLeft ? -ICON_SPACING : ICON_SPACING;
   Collection<BuffBase> collection = ZSSEntityInfo.get(mc.thePlayer).getActiveBuffsMap().values();
   if (!collection.isEmpty()) {
     GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
     GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
     GL11.glDisable(GL11.GL_LIGHTING);
     // alpha test and blend needed due to vanilla or Forge rendering bug
     GL11.glEnable(GL11.GL_ALPHA_TEST);
     GL11.glEnable(GL11.GL_BLEND);
     mc.getTextureManager().bindTexture(textures);
     for (Iterator<BuffBase> iterator =
             ZSSEntityInfo.get(mc.thePlayer).getActiveBuffsMap().values().iterator();
         iterator.hasNext();
         offset = increment) {
       BuffBase buff = iterator.next();
       int index = buff.getIconIndex();
       xPos += (Config.isBuffBarHorizontal ? offset : 0);
       yPos += (Config.isBuffBarHorizontal ? 0 : offset);
       drawTexturedModalRect(
           xPos,
           yPos,
           index % ICONS_PER_ROW * ICON_SIZE,
           index / ICONS_PER_ROW * ICON_SIZE,
           ICON_SIZE,
           ICON_SIZE);
       if (buff.displayArrow()) {
         drawTexturedModalRect(
             xPos, yPos, buff.isDebuff() ? ICON_SIZE : 0, 0, ICON_SIZE, ICON_SIZE);
       }
     }
     GL11.glPopAttrib();
   }
 }
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    bindTexture(texture);
    GL11.glTranslatef(0.5f, -0.25f, 0.5f);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glScalef(0.35f, 0.35f, 0.35f);
    float[] rot = ITorque.forgeDiretctionToRotationMatrix[2];
    if (rot[0] != 0) {
      GL11.glRotatef(rot[0], 1, 0, 0);
    }
    if (rot[1] != 0) {
      GL11.glRotatef(rot[1], 0, 1, 0);
    }
    if (rot[2] != 0) {
      GL11.glRotatef(rot[2], 0, 0, 1);
    }

    float textureWidth = model.textureWidth();
    float textureHeight = model.textureHeight();
    windmillShaft.setRotation(0, 0, 0);
    windmillShaft.render(textureWidth, textureHeight);
    int height = 5;

    bladeShaft.render(textureWidth, textureHeight);
    for (int k = 1; k < height; k++) {
      blade.render(textureWidth, textureHeight);
      if (k == height - 1) {
        bladeJoint.render(textureWidth, textureHeight);
      }
      if (k < height - 1) {
        GL11.glTranslatef(0, 1, 0);
      }
    }
    GL11.glPopAttrib();
    GL11.glPopMatrix();
  }
  private void renderFuels(
      TileEntityFuelConverter tile, double par2, double par4, double par6, Fluid fuel) {

    FluidStack liquid = new FluidStack(fuel, 1);

    int amount = tile.getFuel(liquid);
    if (amount == 0) return;

    int[] displayList = ReikaLiquidRenderer.getGLLists(liquid, tile.worldObj, false);

    if (displayList == null) {
      return;
    }

    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    ReikaLiquidRenderer.bindFluidTexture(fuel);
    ReikaLiquidRenderer.setFluidColor(liquid);

    GL11.glTranslated(par2, par4, par6);

    GL11.glTranslated(0, tile.getLiquidModelOffset(liquid), 0);

    GL11.glTranslated(0, 0.001, 0);
    GL11.glScaled(1, 1 / 3D, 1);
    GL11.glScaled(0.99, 0.95, 0.99);

    GL11.glCallList(
        displayList[(int) (amount / ((double) tile.CAPACITY) * (ReikaLiquidRenderer.LEVELS - 1))]);

    GL11.glPopAttrib();
    GL11.glPopMatrix();
  }
  @Override
  protected final void drawGuiContainerBackgroundLayer(final float f, final int x, final int y) {
    final int ox = this.guiLeft; // (width - xSize) / 2;
    final int oy = this.guiTop; // (height - ySize) / 2;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.drawBG(ox, oy, x, y);

    final List<Slot> slots = this.getInventorySlots();
    for (final Slot slot : slots) {
      if (slot instanceof OptionalSlotFake) {
        final OptionalSlotFake fs = (OptionalSlotFake) slot;
        if (fs.renderDisabled()) {
          if (fs.isEnabled()) {
            this.drawTexturedModalRect(
                ox + fs.xDisplayPosition - 1,
                oy + fs.yDisplayPosition - 1,
                fs.getSourceX() - 1,
                fs.getSourceY() - 1,
                18,
                18);
          } else {
            GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.4F);
            GL11.glEnable(GL11.GL_BLEND);
            this.drawTexturedModalRect(
                ox + fs.xDisplayPosition - 1,
                oy + fs.yDisplayPosition - 1,
                fs.getSourceX() - 1,
                fs.getSourceY() - 1,
                18,
                18);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glPopAttrib();
          }
        }
      }
    }
  }