+ char *buf = (char*)alloca(max_line_size + 1);
+
+ float dy = dtx_line_height() * text_scale;
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glTranslatef(rect.x + text_padding, rect.y + dy + text_padding, 0);
+ glScalef(text_scale, -text_scale, text_scale);
+
+ glColor3fv(color[COL_FG]);
+
+ int nlines = text_lines.size() - 1;
+ for(int i=0; i<nlines; i++) {
+ if(i < nlines - 1) {
+ int sz = text_lines[i + 1] - text_lines[i];
+ assert(sz <= max_line_size);
+ memcpy(buf, text_lines[i], sz);
+ buf[sz] = 0;
+ } else {
+ buf = (char*)text_lines[i];
+ }
+
+ dtx_string(buf);
+ glTranslatef(0, -dy, 0);
+ }
+
+ glPopMatrix();