All of my media assets disappear when I load from my exe.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
FlyingSauce
Posts: 18
Joined: Thu Apr 24, 2014 3:01 am

All of my media assets disappear when I load from my exe.

Post by FlyingSauce »

When I run the program from my IDE, everything loads fine. However, when I go to the directory and launch the .exe file, all of my textures and models disappear, and I'm left with nothing but grey space, and cubes that I spawned in the code.



EDIT: Putting files in my bin/Release folder fixed it. Thanks!
Last edited by FlyingSauce on Sat Apr 26, 2014 7:41 pm, edited 1 time in total.
apamment
Posts: 9
Joined: Thu Apr 24, 2014 4:36 am
Location: South Australia
Contact:

Re: All of my media assets disappear when I load from my exe

Post by apamment »

where is your exe in relation to your assets? The IDE probably sets the working directory to where the assets are, but running the exe manually does not.
CuteAlien
Admin
Posts: 9670
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: All of my media assets disappear when I load from my exe

Post by CuteAlien »

You have another working directory when starting an exe directly. Although you can set the working directory also to your exe folder in the IDE. That's an easy workaround that works well for testing (depends on your IDE where you can set that).

Once you release applications you probably should spend some more work on it. There's 2 solutions there - one is working with absolute paths. Most games write their installation paths into the registry on installation and then work with that path. Another solution is building a relative path on application start out of a combination of the current working directory (getcwd) and the first argv parameter of main.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply