+
+ 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();
+}
+
+void exui_draw()
+{
+ if(!exsel_active) return;
+ if(!font) return;
+
+ // render the 2D UI in a texture
+ push_render_target(rtarg);
+ glClear(GL_COLOR_BUFFER_BIT);
+ draw_2d_ui();
+ pop_render_target();
+
+ // place UI image into the scene
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+
+ /*
+ Mat4 mvmat;
+ glGetFloatv(GL_MODELVIEW_MATRIX, mvmat[0]);
+ if(parent) {
+ mvmat = parent->get_matrix() * mvmat;
+ }
+ mvmat.translate(pos.x, pos.y, pos.z);
+
+ mvmat[0][0] = mvmat[1][1] = mvmat[2][2] = 1.0f;
+ mvmat[0][1] = mvmat[0][2] = mvmat[1][0] = mvmat[2][0] = mvmat[1][2] = mvmat[2][1] = 0.0f;
+ glLoadMatrixf(mvmat[0]);
+ */
+ Mat4 xform;
+ if(parent) {
+ xform = parent->get_matrix();
+ }
+ xform = tilt_matrix * xform;
+ xform.pre_scale(scale, scale, scale);
+ glMultMatrixf(xform[0]);
+
+ glPushAttrib(GL_ENABLE_BIT);
+ glEnable(GL_BLEND);
+ glBlendColor(0, 0, 0, 0.35);
+ glBlendFunc(GL_SRC_ALPHA, GL_CONSTANT_ALPHA);
+ glEnable(GL_TEXTURE_2D);
+ glDisable(GL_CULL_FACE);
+ glDepthMask(0);
+
+ glUseProgram(0);
+ bind_texture(rtarg->texture());
+
+ glMatrixMode(GL_TEXTURE);
+ glLoadMatrixf(rtarg->texture_matrix()[0]);
+
+ glBegin(GL_QUADS);
+ glColor3f(1, 1, 1);
+ glTexCoord2f(0, 0); glVertex2f(-size.x / 2, -size.y / 2);
+ glTexCoord2f(1, 0); glVertex2f(size.x / 2, -size.y / 2);
+ glTexCoord2f(1, 1); glVertex2f(size.x / 2, size.y / 2);
+ glTexCoord2f(0, 1); glVertex2f(-size.x / 2, size.y / 2);
+ glEnd();
+
+ glLoadIdentity();