#include <assert.h>
#include "draw.h"
#include "imtk.h"
+#include "drawtext.h"
+#include "demo.h"
#define COLOR_MASK 0xff
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);
}