stuff-from-scratch/src/graphics/DrawingSurface.cpp

41 lines
715 B
C++
Raw Normal View History

2021-04-17 12:57:14 +00:00
#include "DrawingSurface.h"
std::unique_ptr<DrawingSurface> DrawingSurface::Create()
{
return std::make_unique<DrawingSurface>();
}
INativeDrawingSurface* DrawingSurface::GetNativeSurface()
{
if (mNativeDrawingSurface)
{
return mNativeDrawingSurface.get();
}
else
{
return nullptr;
}
}
void DrawingSurface::SetNativeSurface(std::unique_ptr<INativeDrawingSurface> surface)
{
mNativeDrawingSurface = std::move(surface);
}
void DrawingSurface::SetSize(unsigned width, unsigned height)
{
mWidth = width;
mHeight = height;
}
unsigned DrawingSurface::GetWidth() const
{
return mWidth;
}
unsigned DrawingSurface::GetHeight() const
{
return mHeight;
}