#pragma once
#include <memory>
#include <Platform/Windows/WindowsWindow.h>

#include "Core.h"
#include "Layer.h"
#include "LayerStack.h"
#include "Hazel/Core/TimeStep.h"
#include "Hazel/ImGui/ImGuiLayer.h"

namespace Hazel {

	class HAZEL_API Application
	{
	public:
		Application(const std::string& name = "Hazel App", int width = 1280, int height = 720);
		virtual ~Application();

		void Run();

		void OnEvent(SDL_Event& e);
		void OnWindowResize(SDL_Event& e);
		void PushLayer(Layer* layer);
		void PushOverlay(Layer* layer);

		void Close();

		ImGuiLayer* GetImGuiLayer() const { return m_imguiLayer; }

		inline Window&             GetWindow() const { return *m_Window; }
		inline static Application& Get() { return *s_Instance; }

	private:
		Scope<Window> m_Window;
		ImGuiLayer* m_imguiLayer;
		bool m_Running = true;

		LayerStack m_layerStack;

		TimeStep m_TimeStep;
		float m_lastFrameTime = 0.0f;

		bool m_Minimized = false;
	private:
		static Application* s_Instance;
	};

	// to be defined int CLIENT
	Application* CreateApplication();

}
