Add Device and Window abstraction

This commit is contained in:
Thraix
2023-03-04 23:02:42 +01:00
parent 1e7d08250e
commit c975ed2674
47 changed files with 854 additions and 614 deletions
+37
View File
@@ -0,0 +1,37 @@
#pragma once
#include "copium/core/Vulkan.h"
#include "copium/util/Common.h"
#include <GLFW/glfw3.h>
namespace Copium
{
class Window final
{
CP_DELETE_COPY_AND_MOVE_CTOR(Window);
public:
enum class Mode
{
Fullscreen, BorderlessWindowed, Windowed
};
private:
Vulkan& vulkan;
GLFWwindow* window;
VkSurfaceKHR surface;
public:
Window(Vulkan& vulkan, const std::string& windowName, int width, int height, Mode mode);
~Window();
VkSurfaceKHR GetSurface() const;
GLFWwindow* GetWindow();
private:
void InitializeWindow(const std::string& windowName, int width, int height, Mode mode);
void InitializeSurface();
static void FramebufferResizeCallback(GLFWwindow* glfwWindow, int width, int height);
};
}