As it stands, our program just runs for however long it requires, and then just outputs "PNG image generated" and "JPG image generated" at the very end. This is highly undesirable because anyone who runs our program will not know if the program is even working or not, once they start the program.
What to do
- We want to output some sort of message once scene parsing/construction is done. (While this won't matter for now, with our simple scenes, it may well make a difference later on.)
- Keep the user informed about how many lines have been rendered, and how many are remaining.
- Once the rendering is finished, output a message about the PNG/JPG generation, based on the return value of the
stbi_write_png and stbi_write_jpg functions. Note that a non-zero return value indicates a success, and a zero return value indicates a failure to generate the relevant image file.
As it stands, our program just runs for however long it requires, and then just outputs "PNG image generated" and "JPG image generated" at the very end. This is highly undesirable because anyone who runs our program will not know if the program is even working or not, once they start the program.
What to do
stbi_write_pngandstbi_write_jpgfunctions. Note that a non-zero return value indicates a success, and a zero return value indicates a failure to generate the relevant image file.