mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-17 11:25: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:
23
src/io/window.c
Normal file
23
src/io/window.c
Normal 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
12
src/io/window.h
Normal 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);
|
||||
Reference in New Issue
Block a user