#include "PainterFactory.h"

#ifdef HAS_OPENGL
#include "OpenGlPainter.h"
#include "OpenGlMeshPainter.h"
#include "OpenGlTextPainter.h"
#include "OpenGlShaderProgram.h"
#include "OpenGlFontTexture.h"
#endif

#include "Grid.h"
#include "RasterPainter.h"
#include "DrawingContext.h"

#ifdef _WIN32
#include "DirectXPainter.h"
#include "DirectXMesh.h"
#include "DirectXMeshPainter.h"
#include "DirectXTextPainter.h"
#endif


std::unique_ptr<AbstractPainter> PainterFactory::Create(DrawingContext* context, DrawingMode drawMode)
{
#ifdef _WIN32
    if (drawMode == DrawingMode::GRAPH)
    {
        return std::make_unique<DirectXPainter>(context);
    }
    else
    {
        return std::make_unique<RasterPainter>(context);
    }
#else
    #ifdef HAS_OPENGL
        if (drawMode == DrawingMode::GRAPH)
        {
            return std::make_unique<OpenGlPainter>(context);
        }
        else
        {
            return std::make_unique<RasterPainter>(context);
        }
    #else
        (void)drawMode;
        return std::make_unique<RasterPainter>(context);
    #endif
#endif
}


