LWJGL Forum

Archive => DevIL => Topic started by: DanDanger on March 24, 2005, 22:25:33

Title: ilLoadFromStream
Post by: DanDanger on March 24, 2005, 22:25:33
Hello all!

Just adding to the pool of knowledge:

Has anyone used IL.ilLoadFromStream() ? I was tryng to use it and thought it was crashing but it turns out it was taking about 30 secs to load my image from a jar file.

I now use this code , which runs fine, instead :

            InputStream is = new BufferedInputStream( getClass().getResourceAsStream(path));

            ByteBuffer bb = ByteBuffer.allocateDirect(is.available()).order(ByteOrder.nativeOrder());
            byte[] ba = new byte[(int)is.available()];
            is.read(ba);
            bb.put(ba);
            bb.clear();
            IL.ilLoadL(IL.IL_TGA,bb,is.available());
            IL.ilLoadFromStream()
            is.close();
Title: ilLoadFromStream
Post by: Matzon on March 24, 2005, 23:16:46
the current implementation is rather unoptimized. I am working on making devil load dynamically and will optimize the method while I am at it.
Title: ilLoadFromStream
Post by: Matzon on March 25, 2005, 09:26:09
fixed in CVS. Loads in a splitsecond now :)
Title: ilLoadFromStream
Post by: DanDanger on April 20, 2005, 11:32:59
yeah!

Ill have to get that from CVS, as soon as I figure out how to use cvs :)
Title: ilLoadFromStream
Post by: Matzon on April 20, 2005, 12:59:39
0.96 includes that fix