4d2dfce31c
- Add linux build system using MakeGen - Fix a swapchain validation error, likelydue to my linux system using a different vulkan version - Make DescriptorPool take in amount of descriptors it needs, instead of allocating a mass amount for every pool, causing loads of RAM/VRAM usage
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "copium/util/Common.h"
|
|
#include "copium/util/Enum.h"
|
|
|
|
#include <vulkan/vulkan.hpp>
|
|
|
|
#define CP_WINDOW_MODE_ENUMS \
|
|
Fullscreen, \
|
|
BorderlessWindowed, \
|
|
Windowed
|
|
|
|
CP_ENUM_CREATOR(Copium, WindowMode, CP_WINDOW_MODE_ENUMS);
|
|
|
|
struct GLFWwindow;
|
|
|
|
namespace Copium
|
|
{
|
|
class Window final
|
|
{
|
|
CP_DELETE_COPY_AND_MOVE_CTOR(Window);
|
|
private:
|
|
GLFWwindow* window;
|
|
VkSurfaceKHR surface;
|
|
|
|
int width;
|
|
int height;
|
|
|
|
public:
|
|
Window(const std::string& windowName, int width, int height, WindowMode mode);
|
|
~Window();
|
|
|
|
bool ShouldClose() const;
|
|
|
|
int GetWidth() const;
|
|
int GetHeight() const;
|
|
VkSurfaceKHR GetSurface() const;
|
|
GLFWwindow* GetWindow();
|
|
|
|
void GrabMouse(bool grap);
|
|
bool IsMouseGrabbed() const;
|
|
|
|
private:
|
|
void InitializeWindow(const std::string& windowName, int width, int height, WindowMode mode);
|
|
void InitializeSurface();
|
|
|
|
static void FramebufferResizeCallback(GLFWwindow* glfwWindow, int width, int height);
|
|
static void KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
|
|
static void MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
|
|
static void MouseMoveCallback(GLFWwindow* window, double xpos, double ypos);
|
|
static void WindowFocusCallback(GLFWwindow* window, int focused);
|
|
static void MouseScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
|
|
};
|
|
}
|