1#ifndef LIBSBX_DEVICES_DEVICES_MODULE_HPP_
2#define LIBSBX_DEVICES_DEVICES_MODULE_HPP_
8#include <unordered_map>
10#include <fmt/format.h>
12#include <GLFW/glfw3.h>
14#include <libsbx/core/module.hpp>
15#include <libsbx/core/engine.hpp>
17#include <libsbx/units/time.hpp>
19#include <libsbx/memory/aligned_storage.hpp>
21#include <libsbx/devices/window.hpp>
22#include <libsbx/devices/input.hpp>
24namespace sbx::devices {
28 inline static const auto is_registered = register_module(stage::pre);
34 throw std::runtime_error{
"Could not initialize glfw"};
37 if (!glfwVulkanSupported()) {
38 throw std::runtime_error{
"Glfw does not support vulkan"};
53 auto update() ->
void override {
54 input::_transition_pressed_keys();
55 input::_transition_pressed_mouse_buttons();
56 input::_transition_scroll_delta();
65 auto required_instance_extensions()
const -> std::vector<const char*> {
66 auto extension_count = std::uint32_t{0};
67 auto extensions = glfwGetRequiredInstanceExtensions(&extension_count);
69 return std::vector<const char*>{extensions, extensions + extension_count};
Definition: module.hpp:72
Definition: devices_module.hpp:26
Definition: window.hpp:33
A class that allows for the manual construction and destruction of an object of type Type.
Definition: aligned_storage.hpp:40
Definition: window.hpp:27