27 lines
693 B
C++
27 lines
693 B
C++
#pragma once
|
|
|
|
#include "terminal.h"
|
|
#include "event.h"
|
|
|
|
|
|
class WindowEvent : public Event {
|
|
const int windowID, event;
|
|
public:
|
|
WindowEvent(int, int);
|
|
|
|
inline int getWindowID() const { return windowID; }
|
|
|
|
EventType getType() const {
|
|
switch(event) {
|
|
case SDL_WINDOWEVENT_CLOSE:
|
|
return EventType::WindowClose;
|
|
case SDL_WINDOWEVENT_RESIZED:
|
|
return EventType::WindowResize;
|
|
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
|
return EventType::WindowFocus;
|
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
|
return EventType::WindowLostFocus;
|
|
}
|
|
return EventType::None;
|
|
}
|
|
}; |