rework logging to be more optimised, and some minor improvements.

removed function definitions and opted for using macros instead.
It now does not have a set limit when it comes to printing (at least,
it's the stdc's limit again). However, it is now no longer possible to
use a character pointer to print information to the screen.
This commit is contained in:
2025-06-12 18:09:23 +02:00
parent e6ffe785cd
commit 7dd464349f
5 changed files with 31 additions and 69 deletions

View File

@@ -6,6 +6,7 @@
#include <GLFW/glfw3.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "../error.h"

View File

@@ -4,6 +4,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include "../error.h"

View File

@@ -6,6 +6,7 @@
#include <GLFW/glfw3.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "../error.h"
@@ -46,11 +47,16 @@ int window_init(void) {
glfwSetKeyCallback(win, key_callback);
// print the OpenGL version information
debug("version info:");
debug("\tvendor: %s", glGetString(GL_VENDOR));
debug("\trenderer: %s", glGetString(GL_RENDERER));
debug("\tversion: %s", glGetString(GL_VERSION));
debug("\tshading lang: %s", glGetString(GL_SHADING_LANGUAGE_VERSION));
debug(
"version info:\n"
"\tvendor: %s\n"
"\trenderer: %s\n"
"\tversion: %s\n"
"\tshading lang: %s\n",
glGetString(GL_VENDOR),
glGetString(GL_RENDERER),
glGetString(GL_VERSION),
glGetString(GL_SHADING_LANGUAGE_VERSION));
return 0;
}