Skip to main content
gamedev.net
🔒 Locked

C++ Paths

Started by Mr_Ridd Oct 8, 2004 at 12:15 AM 3 replies 450+ views
Original Post
Mr_Ridd
Mr_Ridd
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
The ability to succeed is the ability to adapt
Mr_Ridd
Mr_Ridd
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?
The ability to succeed is the ability to adapt
Oluseyi
Oluseyi
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.
Mr_Ridd
Mr_Ridd
Quote:
By default it starts from wherever your binary executable is located


If my binary executable is in my base folder then it should work, shouldn't it?
The ability to succeed is the ability to adapt

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.