Replies: 2 comments 4 replies
-
Would love to get feedback from @tishin about how this might work on Windows. |
Beta Was this translation helpful? Give feedback.
0 replies
-
There is a library that does some limited Swift reflection, that we might be able to extend to do this sort of lookups |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've come up with a way to discover the classes in a given executable image that need to be registered. My idea is to extend the
@Godot
macro like this:In other words, every time the
@Godot
macro is used, the resulting class will also implicitly conform to a special protocol,GodotMacroClass
(name TBD), which can be used at runtime to determine if a class type should be passed toregister(type:)
. This runtime introspection can be performed on Apple OSs using the runtime functionobjc_enumerateClasses
like so:I've devised a simple generic application framework that calls this automatically from the
runGodot()
callback:I'm opening this topic for discussion, so that the people responsible for the other target platforms (Windows, Linux, etc.) can comment on this proposal. I'm open to alternative solutions that could work on platforms that have a much thinner runtime. Comments welcome.
Beta Was this translation helpful? Give feedback.
All reactions