Closed pthom closed 4 years ago
Hi Pascal,
That is a clever solution!
The macro makes it much easier to create examples because no header file needs to be created. The compiler also has to look at less files so the build time should decrease. With all the examples we have now and will be added in the future that is a great advantage.
Thanks! Sam
Hello,
This is a new PR, which should be applied after the Layout Menu PR.
It simplifies the registration of examples via:
An example can now work :
/_loaders_gltf_samples_index.cpp
): the macroBABYLON_REGISTER_SAMPLE
simplifies the registrationSee for example two commits where I did this
Explanations:
will automatically register the example (and make the example name equal to the class name)
BABYLON_REGISTER_SAMPLE
is a macro with some black magic inside, but I tried to explain it clearly: