rename window/render* to io/window*

this makes more sense, as we'll add more source files in this category
This commit is contained in:
Quinn
2025-04-14 13:25:13 +02:00
committed by Quinn
parent cf908a2f65
commit 76e3547313
3 changed files with 7 additions and 7 deletions

23
src/io/window.c Normal file
View File

@@ -0,0 +1,23 @@
// Copyright (c) 2025 Quinn
// Licensed under the MIT Licence. See LICENSE for details
#include "window.h"
#include <GLFW/glfw3.h>
#include <stdlib.h>
// macros for ease of access
#define WIN_NAME "MCA Selector Lite"
#define WIN_DEFAULT_WIDTH 640
#define WIN_DEFAULT_HEIGHT 480
int window_init(struct renderdat* restrict rdat) {
GLFWwindow* const win = glfwCreateWindow(WIN_DEFAULT_WIDTH, WIN_DEFAULT_HEIGHT, WIN_NAME, NULL, NULL);
if (win == NULL) return 1;
rdat->win = win;
return 0;
}
void window_free(struct renderdat* restrict rdat) {
glfwDestroyWindow(rdat->win);
}

12
src/io/window.h Normal file
View File

@@ -0,0 +1,12 @@
// Copyright (c) 2025 Quinn
// Licensed under the MIT Licence. See LICENSE for details
#pragma once
#include <GLFW/glfw3.h>
struct renderdat {
GLFWwindow* win;
};
int window_init(struct renderdat* restrict rdat);
void window_free(struct renderdat* restrict rdat);