From 2ac3b5b8cce87f72f1a96c3eb786198417509533 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 22 Aug 2023 20:24:59 +0200 Subject: [PATCH] Platform/PlatformApplication: define getMessageQueue() here as it is not platform specific. --- source/Platform/PlatformApplication.cpp | 5 +++++ source/Platform/PlatformApplication.h | 9 +++++++-- source/Platform/Unix/UnixApplication.cpp | 5 ----- source/Platform/Unix/UnixApplication.h | 3 --- source/Platform/Win32/Win32Application.cpp | 5 ----- source/Platform/Win32/Win32Application.h | 3 --- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/source/Platform/PlatformApplication.cpp b/source/Platform/PlatformApplication.cpp index 21148f5..7e707f9 100644 --- a/source/Platform/PlatformApplication.cpp +++ b/source/Platform/PlatformApplication.cpp @@ -19,4 +19,9 @@ PlatformApplication* PlatformApplication::get() return &inst; } +MessageQueue& PlatformApplication::getMessageQueue() +{ + return m_messageQueue; +} + } // namespace sp diff --git a/source/Platform/PlatformApplication.h b/source/Platform/PlatformApplication.h index cfd3331..a141f08 100644 --- a/source/Platform/PlatformApplication.h +++ b/source/Platform/PlatformApplication.h @@ -2,13 +2,13 @@ #ifndef SPECTRE_PLATFORM_H #define SPECTRE_PLATFORM_H +#include #include namespace sp { class PlatformInput; class PlatformDisplay; -class MessageQueue; class PlatformApplication : NonCopyable { @@ -23,7 +23,12 @@ public : virtual PlatformInput& getInput() = 0; - virtual MessageQueue& getMessageQueue() = 0; + MessageQueue& getMessageQueue(); + +protected : + + MessageQueue m_messageQueue; + }; } // namespace sp diff --git a/source/Platform/Unix/UnixApplication.cpp b/source/Platform/Unix/UnixApplication.cpp index f2c175f..e9835ff 100644 --- a/source/Platform/Unix/UnixApplication.cpp +++ b/source/Platform/Unix/UnixApplication.cpp @@ -19,9 +19,4 @@ PlatformInput& UnixApplication::getInput() return m_input; } -MessageQueue& UnixApplication::getMessageQueue() -{ - return m_messageQueue; -} - } // namespace sp diff --git a/source/Platform/Unix/UnixApplication.h b/source/Platform/Unix/UnixApplication.h index 1f5c2dc..173aeb1 100644 --- a/source/Platform/Unix/UnixApplication.h +++ b/source/Platform/Unix/UnixApplication.h @@ -17,12 +17,9 @@ public : virtual PlatformInput& getInput(); - virtual MessageQueue& getMessageQueue(); - protected : X11Input m_input; - MessageQueue m_messageQueue; }; } // namespace sp diff --git a/source/Platform/Win32/Win32Application.cpp b/source/Platform/Win32/Win32Application.cpp index b125c7f..c4e5c99 100644 --- a/source/Platform/Win32/Win32Application.cpp +++ b/source/Platform/Win32/Win32Application.cpp @@ -22,9 +22,4 @@ PlatformInput& Win32Application::getInput() return m_input; } -MessageQueue& Win32Application::getMessageQueue() -{ - return m_messageQueue; -} - } // namespace sp diff --git a/source/Platform/Win32/Win32Application.h b/source/Platform/Win32/Win32Application.h index 9fe035d..e95e697 100644 --- a/source/Platform/Win32/Win32Application.h +++ b/source/Platform/Win32/Win32Application.h @@ -22,13 +22,10 @@ public : virtual PlatformInput& getInput(); - virtual MessageQueue& getMessageQueue(); - protected : //Win32Display m_display; Win32Input m_input; - MessageQueue m_messageQueue; }; } // namespace sp