NarcEngine 0.1.1
C++ Vulkan game engine
 
Loading...
Searching...
No Matches
Window.h
1#pragma once
2
3#define GLFW_INCLUDE_VULKAN
4#include <GLFW/glfw3.h>
5
6#include "renderer/SwapChainSupportDetails.h"
7
8namespace narc_engine {
9 class EngineInstance;
10
11 class Window
12 {
13 public:
14 Window();
15 ~Window();
16
17 void init(const EngineInstance* engineInstance);
18
19 inline bool isFramebufferResized() const { return m_framebufferResized; }
20 inline bool shouldClose() const { return m_shouldClose; }
21 inline VkSurfaceKHR getSurface() const { return m_surface; }
22
23 static const char** getRequiredInstanceExtensions(uint32_t* glfwExtensionCount);
24
25 SwapChainSupportDetails querySwapChainSupport(VkPhysicalDevice device) const;
26 void getValidFramebufferSize(int* width, int* height) const;
27 void getFramebufferSize(int* width, int* height) const;
28 VkBool32 isPhysicalDeviceSupported(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) const;
29
30 void update();
31
32 //TODO : MANAGE THIS DIFFERENTLY
33 inline void setFramebufferResized(bool value) { m_framebufferResized = value; }
34
35 private:
36 GLFWwindow* m_window;
37 VkSurfaceKHR m_surface;
38
39 bool m_framebufferResized = false;
40 bool m_shouldClose = false;
41
42 const EngineInstance* m_engineInstance;
43
44 private:
45 static void framebufferResizeCallback(GLFWwindow* window, int width, int height);
46 };
47}
Definition EngineInstance.h:14
Definition SwapChainSupportDetails.h:6