Hello Guest

ilLoadFromStream

  • 4 Replies
  • 14471 Views
ilLoadFromStream
« 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();

*

Offline Matzon

  • *****
  • 2242
ilLoadFromStream
« Reply #1 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.

*

Offline Matzon

  • *****
  • 2242
ilLoadFromStream
« Reply #2 on: March 25, 2005, 09:26:09 »
fixed in CVS. Loads in a splitsecond now :)

ilLoadFromStream
« Reply #3 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 :)

*

Offline Matzon

  • *****
  • 2242
ilLoadFromStream
« Reply #4 on: April 20, 2005, 12:59:39 »
0.96 includes that fix