Program Listing for File application.hpp¶
↰ Return to documentation for file (inexor/vulkan-renderer/application.hpp
)
#pragma once
#include "inexor/vulkan-renderer/input/keyboard_mouse_data.hpp"
#include "inexor/vulkan-renderer/renderer.hpp"
#include "inexor/vulkan-renderer/world/collision_query.hpp"
#include "inexor/vulkan-renderer/world/cube.hpp"
// Forward declarations
namespace inexor::vulkan_renderer::input {
class KeyboardMouseInputData;
} // namespace inexor::vulkan_renderer::input
namespace inexor::vulkan_renderer {
class Application : public VulkanRenderer {
std::vector<std::string> m_vertex_shader_files;
std::vector<std::string> m_fragment_shader_files;
std::vector<std::string> m_texture_files;
std::vector<std::string> m_gltf_model_files;
std::unique_ptr<input::KeyboardMouseInputData> m_input_data;
bool m_enable_validation_layers{true};
std::vector<std::shared_ptr<world::Cube>> m_worlds;
// If the user specified command line argument "--stop-on-validation-message", the program will call
// std::abort(); after reporting a validation layer (error) message.
bool m_stop_on_validation_message{false};
void load_toml_configuration_file(const std::string &file_name);
void load_textures();
void load_shaders();
void load_octree_geometry(bool initialize);
void setup_vulkan_debug_callback();
void setup_window_and_input_callbacks();
void update_imgui_overlay();
void update_uniform_buffers();
void check_octree_collisions();
void process_mouse_input();
public:
Application(int argc, char **argv);
void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods);
void cursor_position_callback(GLFWwindow *window, double x_pos, double y_pos);
void mouse_button_callback(GLFWwindow *window, int button, int action, int mods);
void mouse_scroll_callback(GLFWwindow *window, double x_offset, double y_offset);
void run();
};
} // namespace inexor::vulkan_renderer