You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am following your course here, and I struggled a bit with the shading lecture. This might be a compiler issue, meaning, the compiler stops me from doing things that I do not want.
My geometry.h basically looks the same as here, and multiplying a vector with a scalar value looks like this:
However I found that, since I am following the GSL (core guidelines for c++), and using initializer list constructors ( using the {}, instead of () ), the compiler will either complain, or result in faulty code. This might be due to clang in this case, but I suspect MSVC++ and g++ will result in the same compiler error:
error: type 'float' cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]
Fixes the issue. These are not issues related to the course in itself, but perhaps might be worth noting. If it's irrelevant, just close and remove this issue. Thanks again for awesome content.
The text was updated successfully, but these errors were encountered:
Thank you for your point! In fact, the geometry.h MUST be rewritten completely with modern C++. It was made with c++98 and this is quite ridiculous these days. If you can offer a better implementation, do not hesitate to do a pull request.
So I am following your course here, and I struggled a bit with the shading lecture. This might be a compiler issue, meaning, the compiler stops me from doing things that I do not want.
My geometry.h basically looks the same as here, and multiplying a vector with a scalar value looks like this:
However I found that, since I am following the GSL (core guidelines for c++), and using initializer list constructors ( using the {}, instead of () ), the compiler will either complain, or result in faulty code. This might be due to clang in this case, but I suspect MSVC++ and g++ will result in the same compiler error:
So, changing that to:
Fixes the issue. These are not issues related to the course in itself, but perhaps might be worth noting. If it's irrelevant, just close and remove this issue. Thanks again for awesome content.
The text was updated successfully, but these errors were encountered: