/******************************************************************************
*	File		-	world_view.h
*	Author		-	Joey Pollack
*	Date		-	2022/01/26 (y/m/d)
*	Mod Date	-	2022/01/26 (y/m/d)
*	Description	-	A rendered view of the world
******************************************************************************/

#ifndef WORLD_VIEW_H_
#define WORLD_VIEW_H_

#include <gui/panel.h>
#include <world/world.h>

namespace lunarium 
{ 
    class Texture;
    class FrameBuffer;  
    class OrthographicCamera;
    
namespace editor
{
    class Editor;
    class WorldView : public Panel
    {
    public:
        WorldView(Editor* pEditor);
        void DoFrame();

        void Update(float delta) override;

        void SetWorld(lunarium::World* pWorld);
        lunarium::World* GetWorld();

    private:
        lunarium::World* mpWorld;
        Editor* mpEditor;
        int mWidth;
        int mHeight;
        bool mNewViewSize;
        bool mIsWindowHovered;
        WorldState mWorldState;
        bool mSimRunning;
        bool mSimPaused;
        lunarium::FrameBuffer* mFrameBuffer;
        lunarium::OrthographicCamera* mEditorCamera;
        lunarium::Texture* mpCanvasImage;

    private:    // HELPERS
        void DoToolBar();
    };
    
}}  // lunarium::editor

#endif  // WORLD_VIEW_H_