+static inline void draw_rect(const Rect &rect, int col)
+{
+ glBegin(GL_QUADS);
+ glColor3fv(color[col]);
+ for(int i=0; i<4; i++)
+ glVertex2fv(vrect(rect, i));
+ glEnd();
+}
+
+static void draw_frame(const Rect &rect)
+{
+ draw_rect(rect, COL_BG);
+ glLineWidth(2.0);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ draw_rect(rect, COL_FRM);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+}
+
+static void draw_titlebar(const Rect &rect)
+{
+ draw_rect(rect, COL_FRM);
+
+ const char *title = ex->get_name();
+ if(title) {
+ glPushMatrix();
+ glTranslatef(rect.x + text_padding, rect.y + rect.h - text_padding, 0);
+ glScalef(text_scale, -text_scale, text_scale);
+
+ glColor3fv(color[COL_BG]);
+ dtx_string(ex->get_name());
+ glPopMatrix();
+ }
+}
+
+static void draw_tabs(const Rect &rect)
+{
+}
+
+static void draw_text(const Rect &rect)