Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Getting applications directory?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Juliean   Members   

6869
Like
0Likes
Like

Posted 03 March 2013 - 12:13 PM

Hello,

 

currently when I want to load resources like images etc.. in my application (VS10) I have to give it a path like this:

wstring sFilename = L"../../Editor/Frame/Cursor.png";

Now I've designed my resource loader so that it will append the "../../Editor/"-part. But still, this will only work when the directory is namend "editor". How do I get the real name of the directory the application is in (or, in that case, the upper directory because the app will be in "Editor/Debug"? Its not a big deal but it has bugged me for a while. Any idea?



#2 SiCrane   Moderators   

11765
Like
0Likes
Like

Posted 03 March 2013 - 12:33 PM

In Windows you can use the API function GetModuleFileName() to get the fully qualified name for the process executable. Trim off the file name to get the path.

#3 Trienco   Members   

2555
Like
0Likes
Like

Posted 04 March 2013 - 12:01 AM

Though I would consider changing the project settings to your need, rather than writing your code to work around an inconvenient setup.

 

The path is already relative, so the only problem should be the difference between running from the IDE and running the binary directly.


f@dzhttp://festini.device-zero.de




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.