mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Change decltype to typedef.
This commit is contained in:
parent
7cab64132d
commit
bb563d069d
@ -25,12 +25,12 @@ void PumpEvents()
|
|||||||
SDL_PumpEvents();
|
SDL_PumpEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasEvent(decltype(Event::type) EventType)
|
bool HasEvent(_SDLEventType_ EventType)
|
||||||
{
|
{
|
||||||
return ( SDL_HasEvent(EventType)==SDL_TRUE );
|
return ( SDL_HasEvent(EventType)==SDL_TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasEvent(decltype(Event::type) EventTypeMin,decltype(Event::type) EventTypeMax)
|
bool HasEvent(_SDLEventType_ EventTypeMin,_SDLEventType_ EventTypeMax)
|
||||||
{
|
{
|
||||||
return ( SDL_HasEvents(EventTypeMin,EventTypeMax)==SDL_TRUE );
|
return ( SDL_HasEvents(EventTypeMin,EventTypeMax)==SDL_TRUE );
|
||||||
}
|
}
|
||||||
|
@ -4,21 +4,22 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
typedef SDL_Event Event;
|
typedef SDL_Event Event;
|
||||||
|
typedef decltype(Event::type) _SDLEventType_;
|
||||||
|
|
||||||
int PollEvent(Event& refEvent);
|
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();
|
void PumpEvents();
|
||||||
bool HasEvent(decltype(Event::type) EventType);
|
bool HasEvent(_SDLEventType_ EventType);
|
||||||
bool HasEvent(decltype(Event::type) EventTypeMin,decltype(Event::type) EventTypeMax);
|
bool HasEvent(_SDLEventType_ EventTypeMin,_SDLEventType_ EventTypeMax);
|
||||||
bool EnableEvent(decltype(Event::type) EventType);
|
bool EnableEvent(_SDLEventType_ EventType);
|
||||||
bool DisableEvent(decltype(Event::type) EventType);
|
bool DisableEvent(_SDLEventType_ EventType);
|
||||||
bool IsEventEnabled(decltype(Event::type) EventType);
|
bool IsEventEnabled(_SDLEventType_ EventType);
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
decltype(Event::type) _type_id;
|
_SDLEventType_ _type_id;
|
||||||
int _looper_cnt;
|
int _looper_cnt;
|
||||||
}LooperID;
|
}LooperID;
|
||||||
|
|
||||||
@ -28,7 +29,6 @@ bool operator != (const LooperID&,const LooperID&);
|
|||||||
class Looper
|
class Looper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef decltype(Event::type) _SDLEventType_;
|
|
||||||
Looper();
|
Looper();
|
||||||
/// If Callback does not return 0, then stop transferring this event.
|
/// If Callback does not return 0, then stop transferring this event.
|
||||||
LooperID add(_SDLEventType_ event_type,const std::function<int(Looper&,Event&)>& event_callback);
|
LooperID add(_SDLEventType_ event_type,const std::function<int(Looper&,Event&)>& event_callback);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user