Main Menu

ilLoadFromStream

Started by DanDanger, March 24, 2005, 22:25:33

Previous topic - Next topic

DanDanger

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();

Matzon

the current implementation is rather unoptimized. I am working on making devil load dynamically and will optimize the method while I am at it.

Matzon

fixed in CVS. Loads in a splitsecond now :)

DanDanger

yeah!

Ill have to get that from CVS, as soon as I figure out how to use cvs :)

Matzon

0.96 includes that fix