mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-17 07:55:45 +01:00
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:
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2025 Quinn
|
||||
// Licensed under the MIT Licence. See LICENSE for details
|
||||
#include "render.h"
|
||||
#include "window.h"
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <stdlib.h>
|
||||
@@ -10,7 +10,7 @@
|
||||
#define WIN_DEFAULT_WIDTH 640
|
||||
#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);
|
||||
if (win == NULL) return 1;
|
||||
rdat->win = win;
|
||||
@@ -18,6 +18,6 @@ int render_init(struct renderdat* restrict rdat) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void render_free(struct renderdat* restrict rdat) {
|
||||
void window_free(struct renderdat* restrict rdat) {
|
||||
glfwDestroyWindow(rdat->win);
|
||||
}
|
||||
@@ -8,5 +8,5 @@ struct renderdat {
|
||||
GLFWwindow* win;
|
||||
};
|
||||
|
||||
int render_init(struct renderdat* restrict rdat);
|
||||
void render_free(struct renderdat* restrict rdat);
|
||||
int window_init(struct renderdat* restrict rdat);
|
||||
void window_free(struct renderdat* restrict rdat);
|
||||
@@ -2,7 +2,7 @@
|
||||
// Licensed under the MIT Licence. See LICENSE for details
|
||||
#include "GLFW/glfw3.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
|
||||
|
||||
@@ -10,7 +10,7 @@ static inline int init(void) {
|
||||
glfwInitHint(GLFW_JOYSTICK_HAT_BUTTONS, GLFW_FALSE); // disable joystick buttons
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user