Create WindowEvents
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m38s
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m38s
This commit is contained in:
@@ -90,6 +90,9 @@ namespace ReWindow {
|
||||
bool fullscreen_mode = false;
|
||||
bool vsync = false;
|
||||
|
||||
protected:
|
||||
bool focused = true;
|
||||
|
||||
protected:
|
||||
std::string title = "Redacted Window";
|
||||
|
||||
@@ -97,6 +100,28 @@ namespace ReWindow {
|
||||
RenderingEngine renderingengine;
|
||||
};
|
||||
|
||||
class WindowEvents {
|
||||
public:
|
||||
WindowEvents() = default;
|
||||
public:
|
||||
Event<> OnOpenEvent;
|
||||
Event<> OnClosingEvent;
|
||||
Event<RWindowEvent> OnFocusLostEvent;
|
||||
Event<RWindowEvent> OnFocusGainEvent;
|
||||
Event<float> OnRefreshEvent;
|
||||
Event<WindowResizeRequestEvent> OnResizeRequestEvent;
|
||||
Event<InputServiceEvent> OnInputServiceEvent;
|
||||
public:
|
||||
virtual void OnOpen() {};
|
||||
virtual void OnClosing() {};
|
||||
virtual void OnFocusLost(const RWindowEvent& e) {};
|
||||
virtual void OnFocusGain(const RWindowEvent& e) {};
|
||||
virtual void OnRefresh(float elapsed) {};
|
||||
virtual void OnResizeSuccess() {};
|
||||
virtual bool OnResizeRequest(const WindowResizeRequestEvent& e) { return true; }
|
||||
virtual void OnInput(const InputServiceEvent& e) {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
// This may be better split into multiple component classes.
|
||||
|
Reference in New Issue
Block a user