Absolute references won't work

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
magicaxis
Posts: 12
Joined: Sun Jan 08, 2012 4:19 am

Absolute references won't work

Post by magicaxis »

I'm making an alternative to windows explorer, and I am trying to make it so that as you "Walk around" your filesystem, any images in your folders appear as framed pictures hanging on the wall. But for some reason it says it "Could not open file of texture (directory)".

Code: Select all

picture->setMaterialTexture(0, driver->getTexture(core::stringw(CDir.c_str()) + core::stringw(loc->d_name) + "\\"));
Basically what all that nonsense does is create a string of the absolute directory of the image I need. In the case I am testing, it comes out with this:
C:\\3DOS_dummy_folders\\sacred_chao.png\\
Which leaves the translated line of code as:

Code: Select all

picture->setMaterialTexture(0, driver->getTexture(C:\\3DOS_dummy_folders\\sacred_chao.png\\);
I have quadruple-checked, and that is definitely the directory of the image.
So why can't Irrlicht find it?

The relative equivalent of this works fine with a directory like ("../media/image.png");
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Absolute references won't work

Post by hybrid »

The trailing double slashes look suspicious. Also maybe use forward slashes, that's far more compatible with other systems.
magicaxis
Posts: 12
Joined: Sun Jan 08, 2012 4:19 am

Re: Absolute references won't work

Post by magicaxis »

I've tried both kinds of slashes and removing the trailing ones :(
magicaxis
Posts: 12
Joined: Sun Jan 08, 2012 4:19 am

Re: Absolute references won't work

Post by magicaxis »

Oh no wait, you were totally totally right about the trailing slashes
Post Reply