+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ int nchildren = (int)cur_node->children.size();
+ int ncols = std::max(std::min(cur_node->nfiles, max_ncols), 1);
+
+ int first = start_child % ncols;
+ int col = 0, row = 0;
+ int num_dirs = 0;
+
+ // count directories ...
+ for(int i=0; i<nchildren; i++) {
+ FSNode *node = cur_node->children[i];
+ if(node->type == FSTYPE_DIR) {
+ ++num_dirs;
+ }
+ }
+
+ // draw the directory link lines
+ glUseProgram(glow_link_sdr);
+ set_uniform_float(glow_link_sdr, "tsec", time_sec);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+
+ for(int i=0; i<nchildren; i++) {
+ FSNode *node = cur_node->children[i];
+
+ if(node->type != FSTYPE_DIR) {
+ continue;
+ }
+
+ float angle = (float)col++ / (float)(num_dirs - 1) * max_icon_angle - max_icon_angle * 0.5;
+
+ Mat4 xform;
+ xform.rotate_y(angle);
+ xform.translate(0, -0.6, 0);
+
+ glPushMatrix();
+ glMultMatrixf(xform[0]);
+ glDepthMask(0);
+
+ set_uniform_float(glow_link_sdr, "phase", col * 42.0);
+
+ glBegin(GL_QUADS);
+ glColor3f(0.2, 0.3, 0.8);
+ glTexCoord2f(0, 0);
+ glVertex3f(-0.2, 0, 0.05);
+ glTexCoord2f(1, 0);
+ glVertex3f(0.2, 0, 0.05);
+ glTexCoord2f(1, 1);
+ glVertex3f(0.2, 0, -10.0);
+ glTexCoord2f(0, 1);
+ glVertex3f(-0.2, 0, -10.0);
+ glColor3f(1, 1, 1);
+ glEnd();
+ glPopMatrix();
+
+ glDepthMask(1);
+ }
+
+ // draw the directory labels
+ glUseProgram(glow_font_sdr);
+ col = 0;
+ for(int i=0; i<nchildren; i++) {
+ FSNode *node = cur_node->children[i];
+
+ if(node->type != FSTYPE_DIR) {
+ continue;
+ }
+
+ float angle = (float)col++ / (float)(num_dirs - 1) * max_icon_angle - max_icon_angle * 0.5;
+
+ draw_node_name(node, angle, -0.6, radius * 1.2, false);
+ }
+
+ // then draw file icons
+ glDisable(GL_BLEND);
+ glUseProgram(0);
+ glLineWidth(2.0);
+ col = 0;
+ for(int i=0; i<nchildren; i++) {
+ int idx = (i + first) % nchildren;
+ FSNode *node = cur_node->children[idx];
+
+ if(node->type == FSTYPE_DIR) {
+ ++num_dirs;
+ continue;
+ }
+
+ float angle = icon_angle(col, ncols, max_icon_angle);
+
+ Mat4 xform = rot_xform;
+ xform.translate(0, row * row_spacing + first_row_y, -radius);
+ xform.rotate_y(angle);
+
+ glPushMatrix();
+ glMultMatrixf(xform[0]);
+ iconrend->draw(node);
+ glPopMatrix();
+
+ if(++col >= ncols) {
+ col = 0;
+ ++row;
+ }
+ }
+ glLineWidth(1.0);
+
+ // then draw the file labels
+ glUseProgram(chrome_font_sdr);
+ col = 0;
+ row = 0;
+ for(int i=0; i<nchildren; i++) {
+ int idx = (i + first) % nchildren;
+ FSNode *node = cur_node->children[idx];
+
+ if(node->type == FSTYPE_DIR) {
+ ++num_dirs;
+ continue;
+ }
+
+ float angle = icon_angle(col, ncols, max_icon_angle);
+
+ draw_node_name(node, angle, row * row_spacing + first_row_y - 0.08, radius, false);
+
+ if(++col >= ncols) {
+ col = 0;
+ ++row;
+ }
+ }