Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Using non-resource bitmaps

This topic is 6186 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

I have made an animation using directx and it loads bitmaps. My problem is when I open the ".exe" file, it doesnt work. It only works when I execute it from the compiler. My guess is that it isnt loading the bitmaps properly because they are in the wrong directory or something. Right now, I have put them in both the folder where the cpp files is and the folder with the exe. Any suggestions? Daniel

Share this post

Link to post
Share on other sites
Your users will most likely be running the game from the executable, so the files should be in the same directory as the executable. The problem with running the game from the compiler is that the compiler might set the working directory to somewhere other than where the executable is.

To fix this in Visual C++, open the Project menu and click Settings. Select the configuration you want to modify, and then click the Debug tab. Then type out the directory of your executable in the edit box under ''Working Directory''. Doing this will not modify your program or anything like that, it will just change the working directory that VC++ sets when the program is run from within the compiler. If you do not use Visual C++, try looking through your compiler''s options or something until you can find something similar.

Also, the working directory can change while your program is running (some file-related functions will change it). So, it may be better to get the working directory (the getcwd() or GetCurrentDirectory() functions will do) at the start of the program and store and somewhere, and then use that for opening files.

If any of this is unclear to you, tell me and I will try to explain it better.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!