예제 #1
0
    public void run() {
      final FileStream file = GlobalFileSystem.getFile(texturePath);
      if (file.exists() == false) {
        Logger.println("Failed to create Texture: " + texturePath, Logger.Verbosity.NORMAL);
        return;
      }

      try {
        final DesktopByteIn in = (DesktopByteIn) file.getByteInStream();
        final InputStream stream = in.getInputStream();
        final BufferedImage image = ImageIO.read(stream);
        in.close();

        synchronized (toBind) {
          // We don't want to bind the BufferedImage now
          // as that will take control of the OpenGL context.
          toBind.add(new Tuple<String, BufferedImage>(texturePath, image));
        }
      } catch (IOException ex) {
        ex.printStackTrace();
      }
    }
예제 #2
0
 private MalletTexture.Meta createMeta(final String _path, final FileStream _file) {
   final DesktopByteIn desktopIn = (DesktopByteIn) _file.getByteInStream();
   return createMeta(_path, desktopIn.getInputStream());
 }