I want to be able to left click in an OpenGL window and have the mouse 
coordinates in that window returned (i.e. relative to the upper left corner of 
the window). Seems like I should be able to do this using Fl::event_x.  However 
it's turning out to be difficult. First of all the only way I can get event_x 
to return anything is to put it in the draw function of my Fl_Gl_Window with 
the syntax Fl::event_x(). But this doesn't return anything when I click in the 
OpenGL window. It ONLY returns coordinates when I click on a button outside the 
OGL window. And the X value returned is relative to main FLTK window. Not what 
I need.

Was hoping to be able to put event_x() in the draw function or in the callback 
to Fl_Gl_Window and get OGL window relative coordinates.

The only idea I have now is to put a large button underneath the OGL window. 
When I click inside the OGL window, this button will be activated and I'll get 
an x cord. relative to the main FLTK window and have to subtract off the upper 
left corner coordinates of the OGL window.

Anyone have a more elegant solution?
_______________________________________________
fltk-opengl mailing list
fltk-opengl@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-opengl

Reply via email to