/******************************************************************************
*	File		-	tester.cpp
*	Author		-	Joey Pollack
*	Date		-	2021/09/15 (y/m/d)
*	Mod Date	-	2021/09/15 (y/m/d)
*	Description	-	Run a series of tests to verify engine functionality
******************************************************************************/

#include "tester.h"
#include "scenes/simpleRenderScene.h"

#include <utils/logger.h>
#include <graphics/igraphics.h>
#include <LunariumConfig.h>

namespace lunarium
{
    Tester::Tester()
        : mpScene(nullptr)
    {

    }

    OpRes Tester::Initialize()
    {
        // return OpRes::Fail("Tester::Initialize not implemented");

        mLogCat = Logger::RegisterCategory("TESTER");

#if BUILD_NO_EDITOR
    Logger::Log(mLogCat, LogLevel::INFO, "BUILDING NO EDITOR!");
#else
    Logger::Log(mLogCat, LogLevel::INFO, "BUILDING WITH THE EDITOR!");
#endif

    Logger::Log(mLogCat, LogLevel::INFO, "Running Simple Render Test Scene");
    mpScene = new SimpleRenderScene(mLogCat);
    mpScene->OnLoad();
        

        return OpRes::OK();
    }
    
    void Tester::Shutdown()
    {
        delete mpScene;
        mpScene = nullptr;
    }
    
    void Tester::OnTick(double delta)
    {
        mpScene->OnTick(delta);
    }
    
    void Tester::OnRender(IGraphics* g)
    {
        mpScene->OnRender(g);
    }
    
}


