#include "../../glc.h" // IWYU pragma: keep i32 window_width_get(Window *win) { glfwGetWindowSize(win->win, &win->width, &win->height); return win->width; } i32 window_height_get(Window *win) { glfwGetWindowSize(win->win, &win->width, &win->height); return win->height; } Window window_create(u32 width, u32 height, const char *title) { glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); GLFWwindow *glfw_window = glfwCreateWindow(width, height, title, NULL, NULL); if (glfw_window == NULL) { err("Failed to create GL window\n"); } glfwMakeContextCurrent(glfw_window); if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { err("Failed to initialize glad\n"); } glViewport(0, 0, width, height); glfwSetFramebufferSizeCallback(glfw_window, (GLFWframebuffersizefun)window_framebuffer_size_callback); return (Window){ glfw_window, width, height }; } void window_destroy(Window *win) { glfwDestroyWindow(win->win); }