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
Are there plans to document how fenestra works and how one can get started w extending this beauty of a project? Would like to understand the event system a little better
The text was updated successfully, but these errors were encountered:
Hey! Absolutely yeah.
For now, the Fenestra-Template repo has some comments about how to use everything and also ImHex serves as a great example of how things work. Especially the event system is basically 1:1 identical.
The event system basically lets you define events using EVENT_DEF(EventName, ParameterType1, ParameterType2); in a header and then other code can subscribe to that event using EventName::subscribe([](auto x, auto y){ });. Then every time something calls EventName::post(1, 2);, all subscribers get executed with those parameters
EVENT_DEF(EventTest, std::string, int);
intmain() {
EventTest::subscribe([](const std::string &value1, int value2) {
fene::log::info("First function called with '{}' and '{}'", value1, value2);
});
EventTest::subscribe([](const std::string &value1, int value2) {
fene::log::info("Second function called with '{}' and '{}'", value1, value2);
});
EventTest::post("Hello World", 123); // Prints "First function called with 'Hello World' and '123'" and "Second function called with 'Hello World' and '123'"
}
Are there plans to document how fenestra works and how one can get started w extending this beauty of a project? Would like to understand the event system a little better
The text was updated successfully, but these errors were encountered: