Add NullWindow Implementation

This commit is contained in:
McMassiveNZ
2023-05-03 22:30:09 +02:00
parent 908c5440d3
commit 101f1405cc
2 changed files with 33 additions and 0 deletions

View File

@@ -7,9 +7,15 @@ set(STARTER_WINDOW_SRC
) )
source_group("" FILES ${STARTER_WINDOW_SRC}) source_group("" FILES ${STARTER_WINDOW_SRC})
if(MSVC)
set(PLATFORM_SRC set(PLATFORM_SRC
platform/win32_window.cpp platform/win32_window.cpp
) )
else()
set(PLATFORM_SRC
platform/null_window.cpp
)
endif()
source_group(platform FILES ${PLATFORM_SRC}) source_group(platform FILES ${PLATFORM_SRC})
list(APPEND SOURCE_FILES ${PLATFORM_SRC}) list(APPEND SOURCE_FILES ${PLATFORM_SRC})

View File

@@ -0,0 +1,27 @@
#include "../window.h"
namespace starter_window
{
class NullWindowImpl : public Window
{
public:
NullWindowImpl() = default;
~NullWindowImpl() override = default;
NullWindowImpl(NullWindowImpl&&) = delete;
NullWindowImpl& operator=(NullWindowImpl&&) = delete;
NullWindowImpl(const NullWindowImpl&) = delete;
NullWindowImpl& operator=(const NullWindowImpl&) = delete;
bool PumpMessages() override { return true; }
};
} // namespace starter_window
std::unique_ptr<starter_window::Window> swCreateWindow(starter_window::WindowCreateParams)
{
auto result = std::make_unique<starter_window::NullWindowImpl>();
return result;
}