C++ Paths
Hey
Say I have a base folder for my game, and in there have a folder called 'utils' and one called g_media. Inside utils there are files like Tools.c/h, Event.h etc.
Now if I, for example, load a model from Events.h with the following path, "g_media/models/world/huts/hut_01.3DS" it says that it cannot find the path. It appears as though I need to go back one directory. Surely this isn't the case, won't it start from my base directory?
Thanks
is your default executable directory ../ (relative to the project and source files, I mean)?
does "../g_media/models/world/huts/hut_01.3DS" work?
does "../g_media/models/world/huts/hut_01.3DS" work?
Yeah I tried that. I'm not sure if it worked because when I tried it it didn't but now that I think about it I might of done something else wrong with other model loading code.
Anyway... do I have to do something like that? Shouldn't it start from the base folder?
Anyway... do I have to do something like that? Shouldn't it start from the base folder?
Quote:Original post by Mr_RiddNo. By default it starts from wherever your binary executable is located. As far as the binary is concerned, the source and header files don't exist (and never did).
Anyway... do I have to do something like that? Shouldn't it start from the base folder?
Create an initialization/configuration file in the same directory as the binary executable (or use a Registry key if you're on Windows) and store all configuration data such as the media files directory in there.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement