diff options
author | Julien Gouesse <[email protected]> | 2013-04-06 11:41:18 +0200 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2013-04-06 11:41:18 +0200 |
commit | 742f72f5288e399627940818b25cc22585fc4596 (patch) | |
tree | 0a02a07d7d0133c86070b68c96e494d59328288f /ardor3d-jogl | |
parent | 5ba6472f0cf909d990485de847022c3ca043047e (diff) |
Repairs the JOGL image loader (still no support of the 'flipped' flag)
Diffstat (limited to 'ardor3d-jogl')
-rw-r--r-- | ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageLoader.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageLoader.java b/ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageLoader.java index 33b6118..08e0367 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageLoader.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/image/util/jogl/JoglImageLoader.java @@ -25,6 +25,7 @@ import javax.media.opengl.GLProfile; import com.ardor3d.image.Image; import com.ardor3d.image.PixelDataType; import com.ardor3d.image.util.ImageLoader; +import com.ardor3d.image.util.ImageLoaderUtil; import com.ardor3d.scene.state.jogl.util.JoglTextureUtil; import com.ardor3d.util.geom.BufferUtils; import com.jogamp.common.nio.Buffers; @@ -37,15 +38,18 @@ public class JoglImageLoader implements ImageLoader { private static boolean createOnHeap = false; - private static final String[] supportedFormats = new String[] { TextureIO.DDS, TextureIO.GIF, TextureIO.JPG, - TextureIO.JPG, TextureIO.PAM, TextureIO.PNG, TextureIO.PNG, TextureIO.PPM, TextureIO.SGI, TextureIO.TGA, - TextureIO.TIFF }; + private static final String[] supportedFormats = new String[] { "." + TextureIO.DDS.toUpperCase(), + "." + TextureIO.GIF.toUpperCase(), "." + TextureIO.JPG.toUpperCase(), "." + TextureIO.PAM.toUpperCase(), + "." + TextureIO.PNG.toUpperCase(), "." + TextureIO.PPM.toUpperCase(), "." + TextureIO.SGI.toUpperCase(), + "." + TextureIO.TGA.toUpperCase(), "." + TextureIO.TIFF.toUpperCase() }; public static String[] getSupportedFormats() { return supportedFormats; } - public static void registerLoader() {} + public static void registerLoader() { + ImageLoaderUtil.registerHandler(new JoglImageLoader(), supportedFormats); + } public JoglImageLoader() {} @@ -117,6 +121,9 @@ public class JoglImageLoader implements ImageLoader { } scratch.rewind(); textureDataBuffer.rewind(); + if (flipped) { + + } ardorImage.setWidth(textureData.getWidth()); ardorImage.setHeight(textureData.getHeight()); ardorImage.setData(scratch); |