/******************************************************************************
*	File		-	simple_render_scene.h
*	Author		-	Joey Pollack
*	Date		-	2021/10/27 (y/m/d)
*	Mod Date	-	2021/10/27 (y/m/d)
*	Description	-	Displays a simple scene that tests basic render features.
******************************************************************************/

#ifndef SIMPLE_RENDER_SCENE_H_
#define SIMPLE_RENDER_SCENE_H_

#include "base_scene.h"
#include <renderer/renderer2D.h>
#include <core/types.h>
#include <utils/high_resolution_timer.h>
#include <string>

namespace lunarium
{
    class Texture;
    class FrameBuffer;
    class SimpleRenderScene : public BaseScene
    {
    public:
        SimpleRenderScene(uint32_t logCat);
        ~SimpleRenderScene();
        virtual void OnLoad();
        virtual void OnTick(double delta);
        void RenderScene(Renderer2D& g);
        void RenderBatchStressTest(Renderer2D& g);

    private:
        
        int mTextBoxWidth;
        Sizei mImageSize;
        Texture* mpRenderedImage;
        Texture* mpTestImageLoad;
        Texture* mpTestImageLoad2;
        FrameBuffer* mFrameBufferOne;
        FrameBuffer* mFrameBufferTwo;
        float angle;
        float box_angle;

        float mSrcWidth;
        float mSrcHeight;

        HighResTimer mTimer;
        double mFrameTime;
        i64 mNumFrames;
        Renderer2D::FrameStats mRenderStats;

        bool mStressTest;

        int mNumQuadsToRender = 500;
        bool mUseTextures = false;
        const int NUM_QUADS = 50000;
        Color* mQuadColors;
        Rectangle* mQuads;
        Texture** mQuadTexures;

        struct GridTestObj
        {
            int X;
            std::string msg;
        };

    private:
        void DrawStatsGUI();
    };
}

#endif  // SIMPLE_RENDER_SCENE_H_