Package org.newdawn.slick.opengl

Examples of org.newdawn.slick.opengl.Texture


        if (isSquare) {
          render = Math.abs(playerX - (int) e.posX) < (map.renderSize / 2) - 6 && Math.abs(playerZ - (int) e.posZ) < (map.renderSize / 2) - 6;
        } else {
          render = MinimapUtils.insideCircle(circleX, circleY, (map.renderSize / 2) - 4, (int) e.posX, (int) e.posZ);
        }
        Texture tex = w.getTexture();
        if (render && tex != null) {
          GL11.glPushMatrix();
          if (isSquare && isShowBackground) { // Square Map with ancient-style texture
            GL11.glTranslatef(-34.0f, 30.0f, 0.0f);
          } else if (isSquare) { // Square Map with basic texture
            GL11.glTranslatef(-36.0f, 32.0f, 0.0f);
          } else if (isShowBackground) { // Round Map with ancient-style texture
            GL11.glTranslatef(-32.0f, 32.0f, 0.0f);
          } else { // Round Map with basic texture
            GL11.glTranslatef(-31.0f, 31.0f, 0.0f);
          }
          GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F);
          switch (MinimapConfig.getInstance().getZoom()) {
          case 0:
            GL11.glTranslated(-entityZ, entityX, 0F);
            break;
          case 1:
            GL11.glTranslated(-entityZ * 0.45F, entityX * 0.45F, 0F);
            break;
          case 2:
            GL11.glTranslated(-entityZ * 0.25F, entityX * 0.28F, 0F);
            break;
          }
          GL11.glScaled(0.05, 0.05, 0.05);
          if (MinimapConfig.getInstance().isSquare()) {
            GL11.glTranslated(-34f, -30f, 0); // Handles entity face offset for the square map
          } else {
            GL11.glTranslated(-32f, -32f, 0); // Handles entity face offset for the round map
          }
          GL11.glRotatef(-90, 0, 0, 1); // Handles entity face orientation
          tex.bind();
          drawOnMap();
          GL11.glPopMatrix();
        }
      }
    }
View Full Code Here


   * @throws IOException
   *             Indicates a failure to access the resource
   */
  public static Texture getTexture(String resourceName,
      BufferedImage resourceImage) throws IOException {
    Texture tex = getTexture(resourceName, resourceImage,
        GL11.GL_TEXTURE_2D, // target
        GL11.GL_RGBA8, // dest pixel format
        GL11.GL_LINEAR, // min filter (unused)
        GL11.GL_LINEAR);

View Full Code Here

   * @throws IOException
   *             Indicates a failure to access the resource
   */
  public static Texture getTexture(String resourceName,
      BufferedImage resourceImage, int filter) throws IOException {
    Texture tex = getTexture(resourceName, resourceImage,
        GL11.GL_TEXTURE_2D, // target
        GL11.GL_RGBA8, // dest pixel format
        filter, // min filter (unused)
        filter);

View Full Code Here

    GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT);

    int maxWidth = 0, totalHeight = 0, lines = 0;
    int extraX = 0, extraY = ascent;
    boolean startNewLine = false;
    Texture lastBind = null;
    for (int glyphIndex = 0, n = vector.getNumGlyphs(); glyphIndex < n; glyphIndex++) {
      int charIndex = vector.getGlyphCharIndex(glyphIndex);
      if (charIndex < startIndex) continue;
      if (charIndex > endIndex) break;

      int codePoint = text.codePointAt(charIndex);

      Rectangle bounds = getGlyphBounds(vector, glyphIndex, codePoint);
      Glyph glyph = getGlyph(vector.getGlyphCode(glyphIndex), codePoint, bounds, vector, glyphIndex);

      if (startNewLine && codePoint != '\n') {
        extraX = -bounds.x;
        startNewLine = false;
      }

      Image image = glyph.getImage();
      if (image == null && missingGlyph != null && glyph.isMissing()) image = missingGlyph.getImage();
      if (image != null) {
        // Draw glyph, only binding a new glyph page texture when necessary.
        Texture texture = image.getTexture();
        if (lastBind != null && lastBind != texture) {
          GL.glEnd();
          lastBind = null;
        }
        if (lastBind == null) {
          texture.bind();
          GL.glBegin(SGL.GL_QUADS);
          lastBind = texture;
        }
        image.drawEmbedded(bounds.x + extraX, bounds.y + extraY, image.getWidth(), image.getHeight());
      }
View Full Code Here

 
  public void loadTextures() {
    textures = new ArrayList<Texture>();
    try {
      for (String name : config.getTextureNames()) {
        Texture texture = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("game/res/" + name + ".png"));
        textures.add(texture);
      }
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
View Full Code Here

  public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5) {
    if (par4 != 0) {
      Block var6 = Block.blocksList[par4];
      // Spout Start
      Texture texture = null;     
      short customId = 0;
      if (SpoutClient.getInstance().getRawWorld() != null) {
        SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par1, par2, par3);
        customId = sChunk.getCustomBlockId(par1, par2, par3);
        short[] customBlockIds = sChunk.getCustomBlockIds();
View Full Code Here

    if (var5 != 0) {
      Block var6 = Block.blocksList[var5];

      // Spout Start
      Texture texture = null;

      short customId = 0;
      if (SpoutClient.getInstance().getRawWorld() != null) {
        SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par1, par2, par3);
        customId = sChunk.getCustomBlockId(par1, par2, par3);
View Full Code Here

          org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(par2ItemStack.getItemDamage());
          design = block != null ? block.getBlockDesign() : null;
          textureURI = design != null ? design.getTextureURL() : null;
        }
        if (textureURI != null) {
          Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);
          if (texture != null) {
            SpoutClient.getHandle().renderEngine.bindTexture(texture.getTextureID());
            custom = true;
          }
        }
      }
    }
View Full Code Here

            org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(var10.getItemDamage());
            design = block != null ? block.getBlockDesign() : null;
            textureURI = design != null ? design.getTextureURL() : null;
          }
          if (textureURI != null) {
            Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);
            if (texture != null) {
              SpoutClient.getHandle().renderEngine.bindTexture(texture.getTextureID());
              custom = true;
            }
          }
        }
      }
View Full Code Here

          org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(var7);
          design = block != null ? block.getBlockDesign() : null;
          textureURI = design != null ? design.getTextureURL() : null;
        }
        if (textureURI != null) {
          Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);
          if (texture != null) {
            Minecraft.getMinecraft().getTextureManager().bindTexture(texture.getTextureID());
            custom = true;
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.opengl.Texture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.