1
0
Fork 0

System/SystemEvent: Merge with Input/InputEvent into just Event.

This commit is contained in:
Henrik Hautakoski 2020-01-30 22:40:09 +01:00
parent 858e721451
commit 10198484e7
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
12 changed files with 152 additions and 80 deletions

View file

@ -3,7 +3,7 @@
namespace sp {
struct SysEvent;
struct Event;
// Interface for platform specific event queue.
class PlatformEventQueue
@ -13,7 +13,7 @@ public :
// Poll one event from the platform's event queue.
// Returns false if there was no events.
// NOTE: This method is guaranteed to be non-blocking.
virtual bool poll(SysEvent& event) = 0;
virtual bool poll(Event& event) = 0;
};
} // namespace sp

View file

@ -6,7 +6,7 @@
namespace sp {
bool Win32EventQueue::poll(SysEvent& event)
bool Win32EventQueue::poll(Event& event)
{
MSG msg;
@ -19,11 +19,11 @@ bool Win32EventQueue::poll(SysEvent& event)
return false;
}
LRESULT Win32EventQueue::processMessage(MSG msg, SysEvent& event)
LRESULT Win32EventQueue::processMessage(MSG msg, Event& event)
{
switch(msg.message) {
case WM_QUIT :
event.type = SysEvent::Quit;
event.type = Event::Quit;
return 0;
// Input, Forward to devices.
case WM_KEYDOWN :

View file

@ -2,7 +2,7 @@
#define PLATFORM_WIN32_EVENT_QUEUE_H
#include <windows.h>
#include <Spectre/System/SystemEvent.h>
#include <Spectre/System/Event.h>
#include <Platform/PlatformEventQueue.h>
namespace sp {
@ -10,11 +10,11 @@ namespace sp {
class Win32EventQueue : public PlatformEventQueue
{
public :
virtual bool poll(SysEvent& event);
virtual bool poll(Event& event);
private :
LRESULT processMessage(MSG msg, SysEvent& event);
LRESULT processMessage(MSG msg, Event& event);
};
} // namespace sp