model view prototype
[convexer.git] / cxr / cxr_log.h
diff --git a/cxr/cxr_log.h b/cxr/cxr_log.h
new file mode 100644 (file)
index 0000000..48ebadf
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef CXR_LOG_H
+#define CXR_LOG_H
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "cxr_types.h"
+
+static void (*cxr_log_func)(const char *str);
+static void (*cxr_line_func)( v3f p0, v3f p1, v4f colour );
+
+static void cxr_log( const char *fmt, ... )
+{
+   char buf[512];
+
+   va_list args;
+   va_start( args, fmt );
+   vsnprintf( buf, sizeof(buf)-1, fmt, args );
+   va_end(args);
+
+   if( cxr_log_func )
+      cxr_log_func( buf );
+
+   fputs(buf,stdout);
+}
+
+
+#endif /* CXR_LOG_H */