Open tsadarsh opened 1 month ago
Hello @tsadarsh
The definition of the struct TGAColor looks different in the tgaimage.h I loaded up from the tinyrenderer repository. Which tgaimage.h
are you using?
I am referring to the current (master) branch. Here is the file tgaimage.h.
@tsadarsh I see. So this is the problem, why the code does not work, because this is the wrong tgaimage.h
file you are referring. If you look at the README.md file @ssloy writes:
... The entire code is available on github, and [here](https://github.com/ssloy/tinyrenderer/tree/909fe20934ba5334144d2c748805690a1fa4c89f) you will find the source code I give to my students.
So no, I do not think that the Wiki needs any changes. This just in case you meant the README.md file.
And yes, you are right with the code change. Just a detail: I think you should use curly brackets to init a struct, like this:
const TGAColor white = TGAColor{{255, 255, 255, 255}};
It would make sense to add the corresponding constructor to the TGAColor class. Will once I have access to a computer
Thank you @digitsensitive for the clarification.
Compiling my
mesh.cpp
throws the following error in at this line:Going through the definition of
TGAColor
intgaimage.h
it is very clear that it expects an array:So shouldn't
TGAColor(255, 255, 255, 255);
be changed toTGAColor({255, 255, 255, 255});
in the Wiki pages too?Doing so compiles the program successfully without any errors. Is this an actual bug or am I not understanding something?