Jump to content

  • Log In with Google      Sign In   
  • Create Account

Using non-resource bitmaps


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
1 reply to this topic

#1 GameDev135   Members   -  Reputation: 133

Like
Likes
Like

Posted 12 August 2001 - 06:02 AM

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

Sponsor:

#2 Midnight Coder   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 August 2001 - 05:00 PM

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.




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.



PARTNERS