stuff-from-scratch/src/graphics/DrawingSurface.h
2022-05-15 14:58:31 +01:00

37 lines
686 B
C++

#pragma once
#include <memory>
#include "INativeDrawingSurface.h"
class Grid;
class Image;
class DrawingSurface
{
public:
DrawingSurface() = default;
static std::unique_ptr<DrawingSurface> Create();
INativeDrawingSurface* GetNativeSurface();
void SetNativeSurface(std::unique_ptr<INativeDrawingSurface> surface);
void SetSize(unsigned width, unsigned height);
unsigned GetWidth() const;
unsigned GetHeight() const;
void Paint(Grid* grid);
Image* GetAsImage() const;
private:
unsigned mWidth = 0;
unsigned mHeight = 0;
std::unique_ptr<Image> mImageBuffer;
std::unique_ptr<INativeDrawingSurface> mNativeDrawingSurface;
};