#pragma once #include "window.h" #include "event.h" #include "camera.h" #include #include namespace Donut { class VertexArray; class VertexBuffer; class IndexBuffer; class Shader; }; namespace Donut { class Application { public: Application(const std::string& name = "Donut", int width = 1280, int height = 720); ~Application(); void run(); void close(); Window& get_window() { return *m_window; } static Application& get() { return *s_instance; } private: void on_init(); void on_shutdown(); void on_update(); void on_render(); void on_event(Event& event); private: std::unique_ptr m_window; bool m_running; bool m_minimized; std::shared_ptr m_vertex_array; std::shared_ptr m_vertex_buffer; std::shared_ptr m_index_buffer; std::shared_ptr m_shader; std::unique_ptr m_camera; bool m_keys[1024] = { false }; bool m_first_mouse = true; float m_last_x = 0.0f; float m_last_y = 0.0f; float m_delta_time = 0.0f; float m_last_frame = 0.0f; bool m_mouse_dragging = false; static Application* s_instance; }; }