log functions and working opengl context on windows

This commit is contained in:
2026-06-26 23:38:56 +03:00
parent 4b1ade6464
commit cf4a087dc3
5 changed files with 145 additions and 41 deletions

17
src/log.c Normal file
View File

@@ -0,0 +1,17 @@
#include <stddef.h>
#include <stdio.h>
#include <stdarg.h>
void log_error(char* file, size_t line, char* str) {
fprintf(stderr, "[ERROR] %s:%zu: %s\n", file, line, str);
}
void log_errorf(char* file, size_t line, char* fmt, ...) {
fprintf(stderr, "[ERROR] %s:%zu: ", file, line);
va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
fprintf(stderr, "\n");
}