From 52cb15482ed6115f2d83204e1073f2ec55e00ee8 Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Mon, 22 May 2017 19:07:26 +0800 Subject: [PATCH] More Event Functions --- MiniEngine_Event.cpp | 10 ++++++++++ MiniEngine_Event.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/MiniEngine_Event.cpp b/MiniEngine_Event.cpp index fe2ea5d..d3e8720 100644 --- a/MiniEngine_Event.cpp +++ b/MiniEngine_Event.cpp @@ -35,6 +35,16 @@ bool HasEvent(_SDLEventType_ EventTypeMin,_SDLEventType_ EventTypeMax) return ( SDL_HasEvents(EventTypeMin,EventTypeMax)==SDL_TRUE ); } +_SDLEventType_ RegisterEvent(int howMuch) +{ + return SDL_RegisterEvents(howMuch); +} + +bool IsValidEventType(_SDLEventType_ EventType) +{ + return (EventType > SDL_FIRSTEVENT) && (EventType < SDL_LASTEVENT); +} + bool operator == (const LooperID& a,const LooperID& b) { return a._type_id==b._type_id && a._looper_cnt==b._looper_cnt ; diff --git a/MiniEngine_Event.h b/MiniEngine_Event.h index 0f44f23..b3c5ed4 100644 --- a/MiniEngine_Event.h +++ b/MiniEngine_Event.h @@ -17,6 +17,8 @@ bool HasEvent(_SDLEventType_ EventTypeMin,_SDLEventType_ EventTypeMax); bool EnableEvent(_SDLEventType_ EventType); bool DisableEvent(_SDLEventType_ EventType); bool IsEventEnabled(_SDLEventType_ EventType); +_SDLEventType_ RegisterEvent(int howMuch); +bool IsValidEventType(_SDLEventType_ EventType); typedef struct {