mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Add More Event Handling Functions.
Remove Debug Message in _global_timer_executor...
This commit is contained in:
parent
3e2479e216
commit
a33a27dbb0
|
@ -1404,7 +1404,6 @@ namespace MiniEngine
|
||||||
/// Global Executor For class Timer
|
/// Global Executor For class Timer
|
||||||
Uint32 _global_timer_executor(Uint32 interval,void* param)
|
Uint32 _global_timer_executor(Uint32 interval,void* param)
|
||||||
{
|
{
|
||||||
printf("DEBUG: Global Timer Executor.\n");
|
|
||||||
auto p=reinterpret_cast<std::function<Uint32(Uint32 interval)>*>(param);
|
auto p=reinterpret_cast<std::function<Uint32(Uint32 interval)>*>(param);
|
||||||
return (*p)(interval);
|
return (*p)(interval);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,21 @@ int PushEvent(const Event& refEvent)
|
||||||
return SDL_PushEvent(const_cast<Event*>(&refEvent));
|
return SDL_PushEvent(const_cast<Event*>(&refEvent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PumpEvents()
|
||||||
|
{
|
||||||
|
SDL_PumpEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HasEvent(decltype(Event::type) EventType)
|
||||||
|
{
|
||||||
|
return ( SDL_HasEvent(EventType)==SDL_TRUE );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HasEvent(decltype(Event::type) EventTypeMin,decltype(Event::type) EventTypeMax)
|
||||||
|
{
|
||||||
|
return ( SDL_HasEvents(EventTypeMin,EventTypeMax)==SDL_TRUE );
|
||||||
|
}
|
||||||
|
|
||||||
bool operator == (const LooperID& a,const LooperID& b)
|
bool operator == (const LooperID& a,const LooperID& b)
|
||||||
{
|
{
|
||||||
return a._type_id==b._type_id && a._looper_cnt==b._looper_cnt ;
|
return a._type_id==b._type_id && a._looper_cnt==b._looper_cnt ;
|
||||||
|
|
|
@ -9,6 +9,9 @@ int PollEvent(Event& refEvent);
|
||||||
int WaitEvent(Event& refEvent);
|
int WaitEvent(Event& refEvent);
|
||||||
int WaitEventTimeout(Event& refEvent,int ms);
|
int WaitEventTimeout(Event& refEvent,int ms);
|
||||||
int PushEvent(const Event& refEvent);
|
int PushEvent(const Event& refEvent);
|
||||||
|
void PumpEvents();
|
||||||
|
bool HasEvent(decltype(Event::type) EventType);
|
||||||
|
bool HasEvent(decltype(Event::type) EventTypeMin,decltype(Event::type) EventTypeMax);
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user