File Loading Problems (Help)

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
MilitantGolf
Posts: 4
Joined: Fri Dec 13, 2013 11:25 pm

File Loading Problems (Help)

Post by MilitantGolf »

I'm trying to load files form a local directory. but every time I just enter the file my game crashes.
in Short terms I need to find how to get the local directory. so I can change

Code: Select all

mesh = smgr->getMesh("C:/Users/%UserName%/Documents/Visual Studio 2012/Projects/RocketKitty/Debug/SWD.x");
to This

Code: Select all

mesh = smgr->getMesh("SWD.x");
This is important so I can move the game around my computer and other computers without needing to recompile.
Oster200
Posts: 60
Joined: Sun May 06, 2012 6:13 pm

Re: File Loading Problems (Help)

Post by Oster200 »

Well if you do it like this

Code: Select all

mesh = smgr->getMesh("SWD.x");
you will need SWD.x to be in the same directory as the exe. This will get messy because all your media are going to be in one directory so i would recommend making a folder named media in the same directory as your exe and put SWD.x in there as well as all your other object, images, sound etc, than you can call them like this

Code: Select all

mesh = smgr->getMesh("media/SWD.x");
MilitantGolf
Posts: 4
Joined: Fri Dec 13, 2013 11:25 pm

Re: File Loading Problems (Help)

Post by MilitantGolf »

Got it to work Thanks
Post Reply