summaryrefslogtreecommitdiff
path: root/base.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-05 11:42:01 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-05 11:42:01 -0500
commitcefdff9a6a449506ddaeae56a2e038a1a2106846 (patch)
treee5753b372848e62528ed08b5c2d70d406914a16f /base.h
parentf6fe651ed8bedb0308f75a7b15ef913add799848 (diff)
converted everything to modern opengl
for some reason SDL_GL_SwapWindow seems to be in a busy loop?
Diffstat (limited to 'base.h')
-rw-r--r--base.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/base.h b/base.h
index a526c6b..c2cd80d 100644
--- a/base.h
+++ b/base.h
@@ -112,11 +112,8 @@ typedef unsigned long long ullong;
#define no_warn_end
#endif
-#if DEBUG
-#if __unix__
-#define debug_print(...) printf(__VA_ARGS__)
-#else // __unix__
-static void debug_print(char const *fmt, ...) {
+#if _WIN32
+static void print(char const *fmt, ...) {
char buf[256];
va_list args;
va_start(args, fmt);
@@ -124,9 +121,15 @@ static void debug_print(char const *fmt, ...) {
va_end(args);
OutputDebugStringA(buf);
}
-#endif // __unix__
-#define debug_println(...) debug_print(__VA_ARGS__), debug_print("\n")
-#else // DEBUG
+#else
+#define print printf
+#endif
+#define println(...) print(__VA_ARGS__), print("\n")
+
+#if DEBUG
+#define debug_print print
+#define debug_println println
+#else
#define debug_print(...)
#define debug_println(...)
#endif