Colors in Raylib
Steven Schveighoffer
schveiguy at gmail.com
Tue Mar 1 12:29:56 UTC 2022
On 3/1/22 7:22 AM, meta wrote:
> If the type is ``Color`` I think the compiler should allow ``GRAY`` if
> it is a member of ``Color``, isn't how strong statically typed language
> should work? I wonder what is the rational against it? How hard would it
> be to allow it?
The problem is how the original source works.
The only way to define a manifest constant for a struct instance in C is
to #define it.
So I'm sure that if raylib could put that inside the `Color` type it
would, but it can't.
What a D binding should do is exactly what Mike said -- provide a
complete binding as expected, and then add machine-generated nicer APIs.
I actually have an open issue, in case anyone is interested in working
on it: https://github.com/schveiguy/raylib-d/issues/8
-Steve
More information about the Digitalmars-d-learn
mailing list