From 65c8b2e6efbe4218947679103c64c63fccad95e8 Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Tue, 2 May 2017 12:59:57 +0800 Subject: [PATCH] Add Minimum Event Support --- MiniEngine_Event.cpp | 20 ++++++++++++++++++++ MiniEngine_Event.h | 7 +++++++ 2 files changed, 27 insertions(+) diff --git a/MiniEngine_Event.cpp b/MiniEngine_Event.cpp index d129e87..16b8e29 100644 --- a/MiniEngine_Event.cpp +++ b/MiniEngine_Event.cpp @@ -1 +1,21 @@ #include "MiniEngine_Event.h" + +int PollEvent(Event& refEvent) +{ + return SDL_PollEvent(&refEvent); +} + +int WaitEvent(Event& refEvent) +{ + return SDL_WaitEvent(&refEvent); +} + +int WaitEventTimeout(Event& refEvent,int ms) +{ + return SDL_WaitEventTimeout(&refEvent,ms); +} + +int PushEvent(const Event& refEvent) +{ + return SDL_PushEvent(const_cast(&refEvent)); +} diff --git a/MiniEngine_Event.h b/MiniEngine_Event.h index 54ae487..8c92434 100644 --- a/MiniEngine_Event.h +++ b/MiniEngine_Event.h @@ -1,2 +1,9 @@ #pragma once #include "MiniEngine.h" + +typedef SDL_Event Event; + +int PollEvent(Event& refEvent); +int WaitEvent(Event& refEvent); +int WaitEventTimeout(Event& refEvent,int ms); +int PushEvent(const Event& refEvent);