79 lines
1.4 KiB
C++
79 lines
1.4 KiB
C++
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "IWindow.hpp"
|
|
|
|
namespace OpenVulkano
|
|
{
|
|
class BaseWindow : virtual public IWindow
|
|
{
|
|
protected:
|
|
const uint32_t windowId;
|
|
WindowConfiguration windowConfig;
|
|
bool destroyed = false;
|
|
|
|
public:
|
|
BaseWindow() : windowId(CreateWindowId()) {}
|
|
virtual ~BaseWindow() = default;
|
|
|
|
const WindowConfiguration& GetWindowConfiguration() override
|
|
{
|
|
return windowConfig;
|
|
}
|
|
|
|
void SetSize(uint32_t width, uint32_t height) override = 0;
|
|
|
|
bool HasTitle() override
|
|
{
|
|
return WindowMode::WINDOWED == GetWindowMode();
|
|
}
|
|
|
|
const std::string& GetTitle() override
|
|
{
|
|
return windowConfig.title;
|
|
}
|
|
|
|
WindowMode GetWindowMode() override
|
|
{
|
|
return windowConfig.windowMode;
|
|
}
|
|
|
|
void SetPosition(int posX, int posY) override = 0;
|
|
|
|
void Show() override = 0;
|
|
void Hide() override = 0;
|
|
|
|
void Show(const bool show) override { if (show) Show(); else Hide(); }
|
|
|
|
IVulkanWindow* GetVulkanWindow() override
|
|
{
|
|
return nullptr;
|
|
}
|
|
|
|
IOpenGlWindow* GetOpenGlWindow() override
|
|
{
|
|
return nullptr;
|
|
}
|
|
|
|
[[nodiscard]] uint32_t GetWindowId() const override
|
|
{
|
|
return windowId;
|
|
}
|
|
|
|
bool WindowHasBeenDestroyed() const final
|
|
{
|
|
return destroyed;
|
|
}
|
|
|
|
void SetWindowHasBeenDestroyed() final
|
|
{
|
|
destroyed = true;
|
|
}
|
|
};
|
|
}
|