All enums in raylib are super-verbose, owing to the fact that C doesn't do namespaces really. So things like KeyboardKey.KEY_A are painfully verbose.
It might make sense to make a raylibenum module that uses static compilation techniques to redefine the enums into a nicer enum system (e.g. Key.A) I'm picturing something like:
string makeBetterEnum(T)(string prefixToRemove, string newName)
{
string result = "enum " ~ newName ~ " {\n";
string withoutPrefix(string s) { ... }
static foreach(m; __traits(allMembers, T))
result ~= " " ~ withoutPrefix(m) ~ " = " ~ __traits(getMember, T, m).to!string ~ ",\n";
return result ~ "}\n";
}
mixin(makeBetterEnum!KeyboardKey("KEY_", "Key"));
All enums in raylib are super-verbose, owing to the fact that C doesn't do namespaces really. So things like
KeyboardKey.KEY_Aare painfully verbose.It might make sense to make a raylibenum module that uses static compilation techniques to redefine the enums into a nicer enum system (e.g.
Key.A) I'm picturing something like: