some code in the exhibit ui, and first stab at laying out the
[laserbrain_demo] / src / ui.cc
index a0babe4..78c7ece 100644 (file)
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -29,7 +29,8 @@ static Text *txlist;
 
 static long timeout = 2000;
 static long trans_time = 250;
-static dtx_font *font;
+dtx_font *ui_font;
+int ui_font_size = FONTSZ;
 
 void set_message_timeout(long tm)
 {
@@ -108,7 +109,7 @@ void print_textv(const Vec2 &pos, const Vec3 &color, const char *fmt, va_list ap
 
 void draw_ui()
 {
-       if(!font) return;
+       if(!ui_font) return;
 
        while(msglist && msglist->show_until <= time_msec) {
                Message *msg = msglist;
@@ -117,7 +118,7 @@ void draw_ui()
                delete msg;
        }
 
-       dtx_use_font(font, FONTSZ);
+       dtx_use_font(ui_font, ui_font_size);
 
        glMatrixMode(GL_PROJECTION);
        glPushMatrix();
@@ -176,10 +177,10 @@ static bool init()
 
        done_init = true;
 
-       if(!(font = dtx_open_font("data/ui.font", 0))) {
+       if(!(ui_font = dtx_open_font("data/ui.font", 0))) {
                fprintf(stderr, "failed to open font: data/ui.font\n");
                return false;
        }
-       dtx_prepare_range(font, FONTSZ, 32, 127);
+       dtx_prepare_range(ui_font, ui_font_size, 32, 127);
        return true;
 }