#include "DrawingSurface.h"

#include "Image.h"
#include "Scene.h"

#include "RootNode.h"

DrawingSurface::DrawingSurface()
{

}

std::unique_ptr<DrawingSurface> DrawingSurface::Create()
{
    return std::make_unique<DrawingSurface>();
}

void DrawingSurface::setSize(unsigned width, unsigned height, bool)
{
    mWidth = width;
    mHeight = height;
}

unsigned DrawingSurface::getWidth() const
{
    return mWidth;
}

unsigned DrawingSurface::getHeight() const
{
    return mHeight;
}

Scene* DrawingSurface::getScene()
{
    if (!mScene)
    {
        mScene = std::make_unique<Scene>();
    }
    return mScene.get();
}

Image* DrawingSurface::getImage()
{
    if (!mBackingImage)
    {
        mBackingImage = std::make_unique<Image>(mWidth, mHeight);
    }
    return mBackingImage.get();
}
