Sign in to follow this  

C++ Paths

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Quote:
Original post by Mr_Ridd
Anyway... do I have to do something like that? Shouldn't it start from the base folder?
No. 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).

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.

Share this post


Link to post
Share on other sites

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this