Big code changes

This commit is contained in:
2026-08-23 20:46:09 -07:00
parent 7243e13df5
commit 0cb0628101
25 changed files with 1645 additions and 227 deletions
+51
View File
@@ -0,0 +1,51 @@
#pragma once
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <string>
#include <vulkan/vulkan.hpp>
#include <sophia/event.hpp>
#include <sophia/types.hpp>
namespace sophia {
class Window {
public:
Window(const Window&) = delete;
Window& operator=(const Window&) = delete;
Window(int width, int height, const std::string& name = "sophiahaestus");
~Window();
bool shouldClose() { return glfwWindowShouldClose(window); }
int getWidth() const { return this->width; }
int getHeight() const { return this->height; }
vk::Extent2D getExtent() {
return {static_cast<u32>(width), static_cast<u32>(height)};
}
void createSurface(const vk::Instance& instance, vk::SurfaceKHR& surface);
bool wasResized() const { return this->resized; };
void resetResizedFlag() { this->resized = false; }
GLFWwindow* getGLFWwindow() { return this->window; }
private:
static void resizeCallback(GLFWwindow* window, int width, int height);
static void keyEventCallback(GLFWwindow* window,
int key,
int scancode,
int action,
int mods);
void initialize();
int width, height;
bool resized = false;
std::string name;
GLFWwindow* window;
};
} // namespace sophia