registerPath and Netbeans

Hi all! I’m having a problem with the textureloader where it can’t find my texture.

I do something like:


texname = "tex.jpg";
tl.registerPath( "../medias/textures/" );
            app.setTexture( 
                                m_textLoader.loadTexture(   texture ,
                                                            "RGB" , 
                                                            mipmap ,
                                                            Texture.BASE_LEVEL , 
                                                            Texture.BASE_LEVEL_LINEAR ,
                                                            Texture.WRAP
                                                        ) 
                            );

it says that It couldn’t find tex.jpg

I tried putting it in the says directory (of the .class) nothing.

I work with package, so the structure looks like

org/myname/project/prog
org/myname/project/medias

I thought that it begans to look at the root of the package, but no chance :frowning: I’m using netbeans IDE 3.5.1 with java 1.5

thanks alot

From your code, it seems that you should have:

m_textLoader.loadTexture( texname ,
“RGB” , …

where you had texture before.

It seems that loadTexture() calls loadImageFast() if it the texture is not already cached by Xith. Try have a look at the method loadImageFast in TextureLoader.java if still doesn’t work.

lol, yeah I just copy/pasted the last line :stuck_out_tongue:

I’ll check, thanks

No problem :stuck_out_tongue:

Sometimes I stare at line for about 10 min trying to find what’s wrong with it. And it’s always something silly :-[

I think IDEs still have a long way to go. Are there any IDEs with really clever AI built-in? If there isn’t, it’s probably because programmers are aware that we might lose our jobs, and therefore no one wants to code an AI-programer-program in the first place ;p

Well, I’m still having the problem. You know how to get the current working directory of the .class ? or the package

In Eclipse, I’m leaving all the files in the top project folder and things seems to work fine.

At http://java.sun.com/docs/books/tutorial/essential/system/properties.html, you can see some handy information you can get from the system. But it shouldn’t be necessary, that must something else happening.

Well, I found what the problem is! Netbeans sets the working directory to you home directory. When you run your apps from the java command line it works #1. So I changed the working directory to my project directory and it’s fine now!

thanks for the help though :slight_smile: