Problem with relative paths

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
Fastlof
Posts: 3
Joined: Sun Sep 26, 2010 4:28 pm

Problem with relative paths

Post by Fastlof »

I am trying to load textures to my terrain wich are in a relative directory "Textures/...". The problem is that I can compile it, but then it gives a error saying there was a problem converting the relative path to an ablsolute one. Here's on example of how I'm trying to load them:

Code: Select all

VideoDriver->getTexture("Textures/DetailMap.jpg"));
The error says this:
+ this 0x00000000 {Name={...} AbsoluteTransformation={...} RelativeTranslation={...} ...} irr::scene::ISceneNode * const
How do I load a texture correctly form a relative directory? I tried about ten ways and searched on the web, but without results. Any help is appreciated.
no_response
Posts: 26
Joined: Fri Aug 20, 2010 11:07 am
Location: Bulgaria

Post by no_response »

how about

Code: Select all

VideoDriver->getTexture("./Textures/DetailMap.jpg"));
Fastlof
Posts: 3
Joined: Sun Sep 26, 2010 4:28 pm

Post by Fastlof »

That way it doesn't crash (excepting the height map), but also doesn't display anything. I'm using Visual C++ 2008 Express Edition.
no_response
Posts: 26
Joined: Fri Aug 20, 2010 11:07 am
Location: Bulgaria

Post by no_response »

first check where the compiler is set to place the .exe file.
also check the run directory.

<for example, try running your program from the .exe itself, not from the IDE>

does it show any messages like 'unable to open texture : .......'?

post your code.
Fastlof
Posts: 3
Joined: Sun Sep 26, 2010 4:28 pm

Post by Fastlof »

Yes, If I run the executable separately it works. Thank you so much! ;)
Post Reply