+static void draw_2d_ui()
+{
+ dtx_use_font(font, font_size);
+ float rowspc = dtx_line_height() * text_scale;
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ glTranslatef(-1, 1, 0);
+ glScalef(2.0 / ui_width, -2.0 / ui_height, 1);
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+
+ glUseProgram(0);
+
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_TEXTURE_2D);
+ glDisable(GL_LIGHTING);
+ glDisable(GL_DEPTH_TEST);
+ glEnable(GL_SCISSOR_TEST);
+
+ Rect rect = {0, 0, (float)ui_width, (float)ui_height};
+ draw_frame(rect);
+ Rect tbar_rect = {rect.x, rect.y, rect.w, rowspc + text_padding}; // half the padding
+ draw_titlebar(tbar_rect);
+ Rect tabs_rect = {tbar_rect.x, tbar_rect.y + tbar_rect.h, tbar_rect.w, tbar_rect.h};
+ draw_tabs(tabs_rect);
+
+ if(num_tabs) {
+ switch(ex->data[vis_tab].type) {
+ case EXDATA_INFO:
+ {
+ Rect text_rect = {rect.x, tabs_rect.y + tabs_rect.h, rect.w, rect.h - tabs_rect.y - tabs_rect.h};
+ draw_text(text_rect);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ glPopAttrib();
+
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
+}
+