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
Copy file name to clipboardExpand all lines: Readme.md
+53-3Lines changed: 53 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,8 +91,6 @@ Example of console logging (Renderer category, info & trace log level)
91
91
Example of file logging (contains time stamp, category & log level)
92
92

93
93
94
-
I do plan on supporting adding custom categories in the future (similar to Unreal Engines system).
95
-
96
94
### Debugging - Asserts
97
95
- Assert only triggers in debug, the message is an optional parameter that will be logged to the console / file logger.
98
96
- Check triggers in all builds, message is an optional parameter that will be logged to the console / file logger.
@@ -112,7 +110,59 @@ ME_VERIFY(CalculateAndValidatePath(), "Path must be valid");
112
110
```
113
111
114
112
### Event System
115
-
TODO
113
+
The event system is simple to use. The only requirement is storing a Delegate and creating an event class.
114
+
*Note: A MauCor::Delegate<> is implicitly the same type as MauCor::Delegate<void>*
115
+
```cpp
116
+
structTestEvent
117
+
{
118
+
int i = 10;
119
+
};
120
+
121
+
classScene
122
+
{
123
+
MauCor::Delegate<TestEvent> m_DelegateTest{};
124
+
MauCor::Delegate<> m_DelegateVoidTest{};
125
+
};
126
+
```
127
+
128
+
Broadcasting events and listening to events is also fairly simple, but it comes with different options, as you may want an immediate broadcast (which calls the corresponding function immediately when the event is broadcast). Or a delayed broadcast (which calls the corresponding function at the beginning of the next frame when the event is broadcast).
129
+
130
+
Similar to broadcasting, unsubscribes can be done immediately and delayed as well. The default here is to do it delayed, which prevents issues where you may unsubscribe, but there's still a lingering function call, resulting in nullptr or invalid ptr usage.
0 commit comments