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

View File

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

View File

@@ -8,5 +8,5 @@ struct renderdat {
GLFWwindow* win; GLFWwindow* win;
}; };
int render_init(struct renderdat* restrict rdat); int window_init(struct renderdat* restrict rdat);
void render_free(struct renderdat* restrict rdat); void window_free(struct renderdat* restrict rdat);

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT Licence. See LICENSE for details // Licensed under the MIT Licence. See LICENSE for details
#include "GLFW/glfw3.h" #include "GLFW/glfw3.h"
#include "error.h" #include "error.h"
#include "window/render.h" #include "io/window.h"
struct renderdat rdat; // contains the relevant data needed for rendering, contains rubbish data until init was struct renderdat rdat; // contains the relevant data needed for rendering, contains rubbish data until init was
@@ -10,7 +10,7 @@ static inline int init(void) {
glfwInitHint(GLFW_JOYSTICK_HAT_BUTTONS, GLFW_FALSE); // disable joystick buttons glfwInitHint(GLFW_JOYSTICK_HAT_BUTTONS, GLFW_FALSE); // disable joystick buttons
if (!glfwInit()) return 1; // initialize GLFW if (!glfwInit()) return 1; // initialize GLFW
if (render_init(&rdat)) return 1; // initialize the rendering and create a window if (window_init(&rdat)) return 1; // initialize the rendering and create a window
return 0; return 0;
} }