MFC OpenGL
Hi, I'm Developing a MFC Dialog Application. I was able to render OpenGL in the picture control using the HWND and the DC of the pic control. I need to be able to select objects in the Picture control with the mouse. I found some tutorials online but they all assume i'm using the glut functions to create the windows. Also, the view and objects of the window i need to select from changes dependong on the user. I know about GL_SELECT and the selectbuffer but the last value in the select buffer is the x-corrdinate of hte screen not of the window in the dialog. ScreenToClient() only gives me coordiantes for hte Dialog window and not the picture control. Is there a easy way or is there OpenGL functions that can help me. Or can someone help me?
You might want to take a look at the article here
The OpenGL selection buffer will not be present in OpenGL 3 (when it is eventually released) so it's probably best if you learn a technique that does not involve it. The code in the above article does not rely on GLUT, you just need to specify the X and Y coordinates of the mouse when a button is clicked. I hope that's of some help.
The OpenGL selection buffer will not be present in OpenGL 3 (when it is eventually released) so it's probably best if you learn a technique that does not involve it. The code in the above article does not rely on GLUT, you just need to specify the X and Y coordinates of the mouse when a button is clicked. I hope that's of some help.
Member of the NeHe team.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement