hi,

I assume that this can only applies to BASE_LEVEL, There is no way to
generate MULTI_LEVEL_MIPMAP texture wihtout using TextureLoader.

Lan



At 10:29 AM 6/5/2003 -0300, you wrote:

Texture tex = fastLoadJPGTextures("stone.jpg", Texture.BASE_LEVEL, Texture.RGB, 0);



/************ BEGIN CODE  *******************/
/*
*  Try to load JPG textures faster than LoadTexture by using
com.sun.image.codec.jpg.*;
*/
 public Texture2D fastLoadJPGTextures(String path, int mipMapmode, int
format, int level)
   {
     java.awt.image.BufferedImage bImage=null;
     ImageComponent2D buffer = null;
     java.io.FileInputStream fis = null;
     java.io.BufferedInputStream bis = null;

        System.out.println("Loading texture");
       try
    {
      fis = new java.io.FileInputStream(path);
      bis = new java.io.BufferedInputStream(fis);

     com.sun.image.codec.jpeg.JPEGImageDecoder jie =
           com.sun.image.codec.jpeg.JPEGCodec.createJPEGDecoder(bis);
     bImage = jie.decodeAsBufferedImage();

     fis.close();
     }
     catch(java.io.FileNotFoundException fnf)
     {
       System.out.println("File " + path + " not found.");
       return null;
     }
     catch (java.io.IOException ioe)
     {
        System.out.println("Error while loading " + path);
        return null;
     }
     buffer = new ImageComponent2D(ImageComponent.FORMAT_RGB, bImage);

    Texture2D t2d = new Texture2D( mipMapmode, format, bImage.getWidth(),
bImage.getHeight() );
     t2d.setImage(level,buffer);

      return t2d;
  }

Lan Wu-Cavener Dept. of Landscape Architecture

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to