Track tasks and feature requests
Join 40 million developers who use GitHub issues to help identify, assign, and keep track of the features and bug fixes your projects need.
Sign up for free See pricing for teams and enterprisesBuild on Windows - incorrectly saved .ppm format #9
Comments
This comment has been minimized.
This comment has been minimized.
Yes, this issue had already been adressed by this commit. |
This comment has been minimized.
This comment has been minimized.
I love your writeups and walkthroughs! Thanks for putting them together. However, a big obstacle for beginners is that the first code snippets (in both tinyraycaster and tinyraytracer repositories) do not produce matching output when copied/pasted and compiled on Windows machines. I understand that you and many other enthusiasts develop on Linux, but there is nowhere (that I could find) where the reader is warned that the code must be modified in order to follow along on Windows. A bold note at the beginning or quick reminder under the code snippet would be much appreciated. Thanks again for all your hard work. |
This comment has been minimized.
This comment has been minimized.
From my experience, bold reminders are ignored by most readers. That is why I keep this current issue open even if in later commits the bug was fixed. |
This comment has been minimized.
This comment has been minimized.
It's not only about ignoring reminders. It's about someone, who is trying to start from the very beginning step by step, as you recommend in your tutorials, and taking the link to initial commit to try it himself. Then he realizes that output is different comparing to what it should be and it's unclear why, and it takes some time to find where the problem hides. Also for the beginner it's not trivial to find the problem himself. |
This comment has been minimized.
This comment has been minimized.
I do agree with you, this is problematic, but I do not see a satisfactory solution to the problem. I do create bugs (a lot). This repository is a real history of one of my saturdays, not something I prepared for months before. While modifying the very first commit is possible, I do not master git sufficiently to feel a firm ground under my feet with this kind of solution. |
This comment has been minimized.
This comment has been minimized.
Just notice: I think, this is possible to edit it directly on github just as text file, but I can't guarantee consequences. |
Hi!
First of all thank you for great tutorials on 3D graphics.
There is an issue when building project on Windows with GCC. In initial commit in file
tinyraycaster.cpp
in functiondrop_ppm_image
you have:On Windows GCC replaces
\n
in output file with platform specific code0x0D0A
, what is incorrect (it should be0x0A
in the file). This result in incorrect *.ppm image representation.This happens because of opening file in "text" mode. To fix this, file should be opened in "binary" mode, for example like this:
Then everything works correctly. I think this patch would not affect other platforms.