dbg gui, imtk text drawing
[demo_prior] / src / imtk / draw.c
index e1c6fbf..331eeae 100644 (file)
@@ -3,6 +3,8 @@
 #include <assert.h>
 #include "draw.h"
 #include "imtk.h"
+#include "drawtext.h"
+#include "demo.h"
 
 #define COLOR_MASK     0xff
 
@@ -256,15 +258,21 @@ void imtk_draw_disc_frame(int x, int y, float inner, float outer, int subdiv, in
 
 void imtk_draw_string(int x, int y, const char *str)
 {
-       /*
-       glRasterPos2i(x, y);
-       while(*str) {
-               glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, *str++);
-       }
-       */
+       dtx_use_font(fnt_ui, fnt_ui_size);
+
+       glMatrixMode(GL_MODELVIEW);
+       glPushMatrix();
+       glTranslatef(x, y + dtx_line_height() * 0.2, 0);
+       glScalef(1, -1, 1);
+
+       glColor4fv(colors[IMTK_TEXT_COLOR]);
+       dtx_string(str);
+
+       glPopMatrix();
 }
 
 int imtk_string_size(const char *str)
 {
-       return 0;
+       dtx_use_font(fnt_ui, fnt_ui_size);
+       return dtx_string_width(str);
 }