-
- /*unsigned select_buf[1024];
- glSelectBuffer(1024, select_buf);
- glRenderMode(GL_SELECT);
-
- //XXX Hardcoded values
- float xn=((float)(x-800)/960)*0.082843;
- float yn=((float)(y-480)/960)*0.082843;
- float size=(float)4/960*0.082843;
-
- project_3d();
- glLoadIdentity();
-
- double clip[4];
- clip[0]=0.1;
- clip[1]=0;
- clip[2]=xn-size;
- clip[3]=0;
- glClipPlane(GL_CLIP_PLANE0, clip);
- glEnable(GL_CLIP_PLANE0);
-
- clip[0]=-0.1;
- clip[2]=-(xn+size);
- glClipPlane(GL_CLIP_PLANE1, clip);
- glEnable(GL_CLIP_PLANE1);
-
- clip[0]=0;
- clip[1]=0.1;
- clip[2]=yn-size;
- glClipPlane(GL_CLIP_PLANE2, clip);
- glEnable(GL_CLIP_PLANE2);
-
- clip[1]=-0.1;
- clip[2]=-(yn+size);
- glClipPlane(GL_CLIP_PLANE3, clip);
- glEnable(GL_CLIP_PLANE3);
-
- glRotatef(-cam_rot*180/M_PI, 0, 0, 1);
- glTranslatef(-cam_pos.x, -cam_pos.y, -cam_pos.z);
-
- layout_3d.render();
-
- glDisable(GL_CLIP_PLANE0);
- glDisable(GL_CLIP_PLANE1);
- glDisable(GL_CLIP_PLANE2);
- glDisable(GL_CLIP_PLANE3);
-
- unsigned n_records=glRenderMode(GL_RENDER);
- if(n_records)
- {
- Track *track=0;
- unsigned i=0;
- unsigned track_depth=numeric_limits<unsigned>::max();
- for(unsigned j=0; j<n_records; ++j)
- {
- unsigned ns_size=select_buf[i++];
- unsigned min_depth=select_buf[i++];
- ++i; // Skip max_depth
- if(min_depth<track_depth)
- {
- track=(Track *)select_buf[i+ns_size-1];
- track_depth=min_depth;
- }
- i+=ns_size;
- }
-
- return track;
- }
-
- return 0;*/