Beispiel #1
0
 public static LTextureData getTextureData(BufferedImage img) {
   if (img == null) {
     throw new RuntimeException("Source image is null !");
   }
   try {
     return new GLLoader(img);
   } catch (Exception e) {
     LTextures.destroyAll();
     LImage.disposeAll();
     LSystem.gc();
   }
   return new GLLoader(img);
 }
Beispiel #2
0
 public static LTextureData getTextureData(String fileName) {
   if (fileName == null) {
     throw new RuntimeException("Path is null !");
   }
   String key = fileName.trim().toLowerCase();
   LTextureData data = lazyLoader.get(key);
   if (data == null || data.source == null) {
     try {
       lazyLoader.put(key, data = new GLLoader(fileName));
     } catch (Exception e) {
       LTextures.destroyAll();
       LImage.disposeAll();
       LSystem.gc();
       lazyLoader.put(key, data = new GLLoader(fileName));
     }
   }
   return data;
 }