TheAtlasEngine
 
Loading...
Searching...
No Matches
application.hpp
1#pragma once
2#include <core/api.hpp>
3#include <core/window.hpp>
4#include <string>
5#include <renderer/renderer.hpp>
6#include <drivers/vulkan-cpp/vk_imgui.hpp>
7
8namespace atlas {
9
14 std::string name = "Undefined";
15 uint32_t width = 0;
16 uint32_t height = 0;
17 glm::vec4 background_color = { 1.f, 0.5f, 0.5f, 1.f };
18 };
19
31 public:
38
40
45 static float delta_time();
46
53 static float physics_step();
54
58 void execute();
59
65
73 static window& get_window() { return *s_instance->m_window; }
74
75 /* Retrieves the current selected graphics API */
79 static api current_api();
80
81 /* Returns the currently selected swapchain */
87 VkSwapchainKHR get_current_swapchain();
88
95 static void destroy();
96
103 static float aspect_ratio();
104
115 static uint32_t current_frame();
116
124 static uint32_t image_size();
125
126 protected:
127 [[nodiscard]] ref<renderer> renderer_instance() const {
128 return m_renderer;
129 }
130
131 private:
132 void set_current_api(api api);
133
134 private:
135 float m_delta_time = 0.f;
136 ref<window> m_window;
137 ref<renderer> m_renderer = nullptr;
138 glm::mat4 m_proj_view;
139 uint32_t m_current_frame_index = -1;
140 vk::imgui_context m_ui_context;
141 static application* s_instance;
142 };
143
144 ref<application> initialize_application();
145};
represents a single application that gets created by the engine internally
Definition application.hpp:30
static uint32_t current_frame()
Gives you the current frame index which is used for the Vulkan renderer.
static api current_api()
static void destroy()
destroys the application completely
static float delta_time()
static float physics_step()
static float aspect_ratio()
gives you the current aspect ratio based on the dimensions of the window
VkSwapchainKHR get_current_swapchain()
gives you the current swapchain handle
static window & get_window()
we only ever have one window
Definition application.hpp:73
void execute()
Explicitly is used to execute the application's mainloop.
application(const application_settings &p_settings)
constructs a new application
static uint32_t image_size()
Intended to get the image size so when you use current_frame() to get thje frame index,...
void post_destroy()
Performs any post cleanup when user requests the application to close.
Definition vk_imgui.hpp:24
Represent an entire window that lives throughout the entire duration of the application.
Definition window.hpp:18
application properties settings for the window
Definition application.hpp:13