stuff-from-scratch/src/ui/ui_elements/desktop_elements/IPlatformWindow.h
2023-01-17 10:13:25 +00:00

41 lines
719 B
C++

#pragma once
#include <memory>
namespace mt
{
class Screen;
class Window;
}
class IPlatformSurface
{
public:
virtual ~IPlatformSurface() = default;
virtual void beforePaint(mt::Screen* screen) = 0;
virtual void afterPaint(mt::Screen* screen) = 0;
};
class IPlatformWindow : public IPlatformSurface
{
public:
IPlatformWindow(mt::Window* window)
: mWindow(window)
{
}
virtual ~IPlatformWindow() = default;
virtual void show() = 0;
virtual void map() = 0;
virtual void clear() = 0;
virtual void onResize(unsigned width, unsigned height) = 0;
protected:
mt::Window* mWindow{nullptr};
};
using IPlatformWindowPtr = std::unique_ptr<IPlatformWindow>;