PDA

View Full Version : opengl and mfc-dialog



01-21-2003, 07:34 AM
Hello,

I have a code that renders opengl inside a static control in the MFC Dialog box.

How can i handle mouse events, like mouse wheel and exact points of left/right button clicks etc. ??

please give me some pointers here.. i have looked at the STN_CLICKED notifications (SS_NOTIFY) from the static control, but that doesnt seem to do much ?!!!!

pls help!

:-(
niranjan

J P
01-21-2003, 11:51 AM
Simple just put your events like OnMouseMove(...) in your CxxxxDlg class. For the mouse position translate/map to and from the OpenGL window coordinates to mouse (static control)coordinates. I wasn't cleaver enough to query Windows for the control dimensions and location so I had to "calibrate" or eyeball the coefficients for the linear mapping.

01-22-2003, 07:28 AM
Thank You for youe help. I will try it out

http://www.opengl.org/discussion_boards/ubb/smile.gif