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
Enums such as Key, MouseButton, MouseButtonMask, and more using enum class in-engine are not using enum class in godot-cpp, they are just using regular enum. Using enum class improves type safety, but I am not sure if Godot provides a mechanism for godot-cpp to know which enums are using enum class.
This issue is not super important because there is an easy workaround. In my project, I am using these defines that only get used when compiling as a module, and writing KEY_ in my code, which auto-replace when compiled as a module.
Godot doesn't provide this information to us, but I think it would be inappropriate to add it to extension_api.json, because it's so C++-specific or even really godot-cpp-specific because we're the only binding that has the goal of being API compatible with Godot (another theoretical C++ binding that doesn't have this goal could just decide to make all enums as enum class or enum per the type of API they wish to provide).
Maybe we could maintain a list of them in godot-cpp's binding_generator.py?
Godot version
Godot master
godot-cpp version
Master of godot-cpp 6facde3
System information
macOS 14.6.1 arm64
Issue description
Enums such as
Key
,MouseButton
,MouseButtonMask
, and more usingenum class
in-engine are not usingenum class
in godot-cpp, they are just using regularenum
. Usingenum class
improves type safety, but I am not sure if Godot provides a mechanism for godot-cpp to know which enums are usingenum class
.This issue is not super important because there is an easy workaround. In my project, I am using these defines that only get used when compiling as a module, and writing
KEY_
in my code, which auto-replace when compiled as a module.Steps to reproduce
Try using one of the values in the
Key
enum in-engine vs in godot-cpp.Minimal reproduction project
Trivial to reproduce with one line of code in a new godot-cpp GDExtension project.
The text was updated successfully, but these errors were encountered: