Package de.lessvoid.nifty.renderer.lwjgl.render.io

Examples of de.lessvoid.nifty.renderer.lwjgl.render.io.ImageData


      log.warning(e.getMessage());
    }
  }

  private Cursor loadMouseCursor(final String name, final int hotspotX, final int hotspotY) throws IOException {
    ImageData imageLoader = createImageLoader(name);
    ByteBuffer imageData = imageLoader.loadMouseCursorImage(ResourceLoader.getResourceAsStream(name));
    imageData.rewind();
    int width = imageLoader.getWidth();
    int height = imageLoader.getHeight();
    try {
      return new Cursor(width, height, hotspotX, height - hotspotY - 1, 1, imageData.asIntBuffer(), null);
    } catch (LWJGLException e) {
      throw new IOException(e);
    }
View Full Code Here


  private int textureId;

  public LwjglRenderImage(final String name, final boolean filterParam) {
    try {
      log.fine("loading image: " + name);
      ImageData imageLoader;
      if (name.endsWith(".tga")) {
        imageLoader = new TGAImageData();
      } else {
        imageLoader = new ImageIOImageData();
      }
      ByteBuffer imageData = imageLoader.loadImage(ResourceLoader.getResourceAsStream(name));
      imageData.rewind();
      width = imageLoader.getWidth();
      height = imageLoader.getHeight();
      textureWidth = imageLoader.getTexWidth();
      textureHeight = imageLoader.getTexHeight();
      createTexture(imageData, textureWidth, textureHeight, 0, imageLoader.getDepth() == 32 ? GL11.GL_RGBA : GL11.GL_RGB);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.renderer.lwjgl.render.io.ImageData

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.