X-Git-Url: https://harrygodden.com/git/?p=convexer.git;a=blobdiff_plain;f=cxr%2Fcxr_log.h;fp=cxr%2Fcxr_log.h;h=48ebadf474f92b0daf3a49f892d30b4bd762e330;hp=0000000000000000000000000000000000000000;hb=dbd379f76bcb2139fdb5740232511fa789018e10;hpb=8e1b6889db7ce10f8d594539ef74dc4390e8e891 diff --git a/cxr/cxr_log.h b/cxr/cxr_log.h new file mode 100644 index 0000000..48ebadf --- /dev/null +++ b/cxr/cxr_log.h @@ -0,0 +1,28 @@ +#ifndef CXR_LOG_H +#define CXR_LOG_H + +#include +#include + +#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 */