implement some basic rendering boilerplate

This commit is contained in:
Quinn
2025-04-13 01:04:27 +02:00
committed by Quinn
parent 538f20f733
commit ef0063d9aa
3 changed files with 51 additions and 5 deletions

View File

@@ -1,10 +1,25 @@
#include "GLFW/glfw3.h"
#include "error.h"
#include "window/render.h"
struct renderdat rdat; // contains the relevant data needed for rendering, contains rubbish data until init was
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
return 0;
}
static inline void quit(void) {
glfwTerminate();
}
int main(int argc, char** argv) {
(void)argc, (void)argv;
debug("%s", "owo");
info("%s", "owo");
warn("%s", "owo");
error("%s", "owo");
fatal("%s", "owo");
if (init()) fatal("failed to initialize!");
while (1);
quit();
}