Beispiel #1
0
 internal void DispatchEvent(SDL2.SDL_Event ev)
 {
     if (SdlEventHandlers.ContainsKey(ev.type))
     {
         SdlEventHandlers[ev.type]?.Invoke(Owner, ev);
     }
     else
     {
         Log.Debug($"Unsupported generic event: {ev.type}.");
     }
 }
Beispiel #2
0
 internal void RegisterEventHandler(SDL2.SDL_EventType type, SdlEventHandler handler)
 {
     if (SdlEventHandlers.ContainsKey(type))
     {
         Log.Warning($"{type} handler is getting redefined.");
         SdlEventHandlers[type] = handler;
     }
     else
     {
         SdlEventHandlers.Add(type, handler);
     }
 }