projects
/
demo_prior
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dbg gui, imtk text drawing
[demo_prior]
/
src
/
imtk
/
draw.c
diff --git
a/src/imtk/draw.c
b/src/imtk/draw.c
index
e1c6fbf
..
331eeae
100644
(file)
--- a/
src/imtk/draw.c
+++ b/
src/imtk/draw.c
@@
-3,6
+3,8
@@
#include <assert.h>
#include "draw.h"
#include "imtk.h"
#include <assert.h>
#include "draw.h"
#include "imtk.h"
+#include "drawtext.h"
+#include "demo.h"
#define COLOR_MASK 0xff
#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)
{
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)
{
}
int imtk_string_size(const char *str)
{
- return 0;
+ dtx_use_font(fnt_ui, fnt_ui_size);
+ return dtx_string_width(str);
}
}