Jump to content
  • Advertisement
Sign in to follow this  
twhaley3

MFC OpenGL

This topic is 3766 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!