Texture2D- IllegalArgumentException
843799Oct 7 2002 — edited Oct 8 2002Hi...
the following occurs in the last line of this code fragment:
JLabel observer=new JLabel();
classPath=System.getProperty("user.dir");
TextureLoader loader=new TextureLoader(classPath+File.separator+"textures"+File.separator+"metal_9.jpg",observer);
ImageComponent2D image=loader.getImage();
texture_1=new Texture2D();
texture_1.setImage(0,image); <-Exception
java.lang.IllegalArgumentException: cannot set image in default texture
The API-Doc says the following:
java.lang.IllegalArgumentException - if an ImageComponent3D is used in a Texture2D object; if an ImageComponent2D is used in a Texture3D object; or if this object is part of a live scene graph and the image being set at this level is not the same size (width, height, depth) as the old image at this level.
What could be the reason?? I can�t find the problem. I don�t use 2D and 3D. The texture is not part of a scene graph. This class only loads the textures. before the scene graph is constructed.
Thanks for all help
Tweety