/******************************************************************************
*	File		-	worldView.cpp
*	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
******************************************************************************/

#include "world_view.h"
#include <utils/logger.h>
#include <world/world.h>
#include <dearimgui/imgui.h>
#include <editor/editor.h>
#include "../panel_manager.h"

namespace lunarium
{
namespace editor
{
    WorldView::WorldView()
        : Panel("World View", gui::PanelDockZone::DDZ_CENTER ,true), mpWorld(nullptr)
    {

    }

    bool WorldView::DoFrame()
    {
        if (!mIsOpen)
            return false;

        if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar))
        {
            ImGui::End();
            return false;
        }

        ImGui::End();
        return true;
    }
}
}