#include "view.h" #define MSG_TIMEOUT 2 #define MAX_MSG_LEN 80 using namespace vlr; void draw_msg( const char *msg, ... ) { va_list argp; static char display_msg[MAX_MSG_LEN]; static double msg_time = 0; static int width = 0; static int height = 0; double t = dgc_get_time(); int cx = (int) (gui3D.window_width/2 - width / 2); int cy = (int) (0.95 * gui3D.window_height - height / 2); int x1 = cx - 10; int x2 = x1 + width + 20; int y1 = cy - 10; int y2 = y1 + height + 10; if (msg != NULL) { va_start (argp, msg); vsnprintf( display_msg, MAX_MSG_LEN, msg, argp ); msg_time = t + MSG_TIMEOUT; width = glutBitmapLength( GLUT_BITMAP_HELVETICA_18, (const unsigned char*)display_msg ); height = (int) glutBitmapHeight(GLUT_BITMAP_HELVETICA_18); } else { if (t