Hello,
Im working on a small graphics/cad program, I have implemented some small text labels using glut. Otherwise everything else is MFC and standard Opengl.

Im wonder how the "pick" with the mouse or finger just the text and move it around. Since the text is the only use of Glut im wondering if Im overlooking something simple.

Attached is the label drawing code:

void C3DRender:rawPointLabels(double x, double y, char * name )
{
char buffer[100], x_buffer[100],y_buffer[100], units[10];
if(m_bThumbnail) {
return;
}
if( !bShowLabels ) {
return;
}
// draw the callout line
double x_offset = (x + 0.2);
double y_offset = (y + 0.2);
double text_offset = m_Zoom/100;
// draw the callout text
glColor3ub(0,0,0);
glRasterPos2d(x_offset,y_offset);
unsignedint i;
for( i = 0; i < strlen(name); i++ )
{
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, name[i]);
}
glRasterPos2d(x_offset, y_offset - text_offset);
in_mm_res_to_string(x_buffer, x, units);
sprintf(buffer,
"X: %s %s", x_buffer, units);
for( i = 0; i < strlen(buffer); i++ )
{
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, buffer[i]);
}
glRasterPos2d(x_offset, y_offset - 2*text_offset);
in_mm_res_to_string(y_buffer, y, units);
sprintf(buffer,
"Y: %s %s", y_buffer, units);
for( i = 0; i < strlen(buffer); i++ )
{
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, buffer[i]);
}
glBegin(GL_LINES);
glVertex3d(x,y,0);
glVertex3d(x_offset,y_offset,0);
glEnd();
}

Thanks for you help
-Derrek