raylib-cpp
raylib-cpp copied to clipboard
Different Default-Colours Wrapping
I was wondering about the implementation of the Colour that are already provided by raylib... why functions? If there is a reason, I'm sorry, please explain.
But in the mean time I changed them to constexpr's.
I think that's it? If there is something else, please let me know : )
Oh wait the examples...
Getting the following error...
Color.hpp:240:28: error: ‘constexpr const raylib::Color raylib::Color::Magenta’ has incomplete type
240 | static constexpr Color Magenta = MAGENTA
I believe it's because MAGENTA is a macro that's expanded to:
CLITERAL(Color){ 245, 245, 245, 255 }
Since it expands with Color it there, it references the raylib::Color instead of ::Color. I believe...
Not entirely sure if that's correct, but I'm not sure of a good workaround.
the problem ist that a static constexpr can not be from the same type the class it is defined in, rn I'm error hunting the examples
ooh hehe, some function-wrappers don't take the Color class... But rn I dont have time to fix this... I will do it tomorrow
No time urgency. Take all the time you need :)
As long as Color.hpp builds, it'll be easy to find/replace the Color usage.
Color.hpp:249:21: error: the type ‘const raylib::Color’ of ‘constexpr’ variable ‘raylib::RayWhite’ is not literal
249 | constexpr Color RayWhite = RAYWHITE;
Didn't update the docs yet and also don't really know if it's a good idea, or if it works at all, I'm not on Desktop so can't build