goat3d
view exporters/maxgoat/src/logger.cc @ 103:45a9d493e98c
fixed the input latency issue by calling QWidget::update() instead of QGLWidget::updateGL()
update schedules an update instead of redrawing immediately.
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 12 Sep 2015 17:40:02 +0300 |
parents | fdece14403ff |
children |
line source
1 #include <stdio.h>
2 #include <stdarg.h>
3 #include "logger.h"
5 static FILE *logfile;
7 bool maxlog_open(const char *fname)
8 {
9 if(!(logfile = fopen(fname, "wb"))) {
10 return false;
11 }
12 setvbuf(logfile, 0, _IONBF, 0);
13 return true;
14 }
16 void maxlog_close()
17 {
18 if(logfile) {
19 fclose(logfile);
20 }
21 }
23 void maxlog(const char *fmt, ...)
24 {
25 if(!logfile) return;
27 va_list ap;
28 va_start(ap, fmt);
29 vfprintf(logfile, fmt, ap);
30 va_end(ap);
31 }