10 Window::Window(std::weak_ptr<InputHandler> inputHandler, GLFWframebuffersizefun windowResizeCallback) :
14 throw std::runtime_error(
"Failed to initialize glfw!");
18 if (!glfwVulkanSupported()) {
19 throw std::runtime_error(
"Vulkan not supported by glfw!");
23 glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
24 glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
27 "Vulkan Schnee",
nullptr,
nullptr);
30 glfwSetWindowUserPointer(
window, engine);
32 glfwSetFramebufferSizeCallback(
window, windowResizeCallback);
37 if (inputHandler.expired())
throw std::runtime_error(
"Input handler could not be setup. Weak pointer has expired");
44 if (glfwCreateWindowSurface(instance,
window,
nullptr, &surface) != VK_SUCCESS) {
45 throw std::runtime_error(
"failed to create window surface!");
constexpr int INITIAL_WINDOW_HEIGHT
constexpr int INITIAL_WINDOW_WIDTH
EngineCore::Engine * getEngineModule()
gets the pointer to the engine object
static EngineManager & getInstance()
gets a reference to the engine manager
GLFWwindow * getWindowInstance() const
Window(std::weak_ptr< InputHandler > inputHandler, GLFWframebuffersizefun windowResizeCallback)
void createSurface(VkInstance instance, VkSurfaceKHR &surface)
void setupInputHandler(const std::weak_ptr< InputHandler > &inputHandler)
Log category system implementation.