Lokit Khemka
4 posts
Day 037 ReadEntireFile Call failing and BMP not getting loaded
Edited by Lokit Khemka on
When the program is calling DEBUGLoadBMP function, the ReadEntireFile function inside is failing and it is returning ReadResult zero? Please help with this problem. Thank you.

It is happening even if I am using Casey's platform layer.

EDIT: As it turns out, the executable is not loading data from data folder but the directory with the source code. How can I change the data folder?
Simon Anciaux
1051 posts
Day 037 ReadEntireFile Call failing and BMP not getting loaded
You need to set the working directory in the visual studio project properties.
- In the solution explorer > right click on the desired project > properties > set the "working directory" line to the desired directory.

If you're running from the command line, you need to go to the desired directory and launch the executable from there.

 1 2 3 rem Assuming you're in the code folder cd ..\data ..\build\win32_handmade.exe 
Mārtiņš Možeiko
2198 posts / 1 project
Day 037 ReadEntireFile Call failing and BMP not getting loaded
Edited by Mārtiņš Možeiko on
If you're using Visual Studio to run executable, then this was covered in Day 1: