Add NullWindow Implementation
This commit is contained in:
@@ -7,9 +7,15 @@ set(STARTER_WINDOW_SRC
|
||||
)
|
||||
source_group("" FILES ${STARTER_WINDOW_SRC})
|
||||
|
||||
if(MSVC)
|
||||
set(PLATFORM_SRC
|
||||
platform/win32_window.cpp
|
||||
)
|
||||
else()
|
||||
set(PLATFORM_SRC
|
||||
platform/null_window.cpp
|
||||
)
|
||||
endif()
|
||||
source_group(platform FILES ${PLATFORM_SRC})
|
||||
|
||||
list(APPEND SOURCE_FILES ${PLATFORM_SRC})
|
||||
|
||||
27
src/platform/null_window.cpp
Normal file
27
src/platform/null_window.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user