Jump to content
  • Advertisement
Sign in to follow this  
twhaley3

OpenGL MFC opengl

This topic is 3702 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 application using OpenGL. I was able to render OpenGL in the picture control of MFC. The problems is I need to be able to select objects created in opengl. I found some code online and I know i need to use the select buffer and GL_SELECT. However, the last spot int he select buffer is the x coordiante of the mouse on the screen not of the window.Can i still use the glu mouse function since i used the HWND and the DC of the picture control to select the objects. Or is there anothe easy way that will allow me to select the objects?

Share this post


Link to post
Share on other sites
Advertisement
You can use the mouse coordinates which are written in the WM_MOUSEMOVE event
just dtore them in some safe variables and use them when you call the GL_SELECT function, i do like that and it works very good.
I have had problems with the glunproject function under mfc , its strange, i don't know why.

Share this post


Link to post
Share on other sites
Well my problem is that the window I'm trying to select the objects that can be selected move. and every tutorial online says to process the hits check the last value in the selection buffer. However, when i do that its the x-coordinate on the screen. I guess I don't fully understand how OpenGL knows the correct object has been selected.

Share this post


Link to post
Share on other sites
Hi I'm developing a MFC application using OpenGL. I was able to render OpenGL using the picture control of a MFC Dialog. The problems is I need to be able to select objects created in opengl. I found some code online and I know i need to use the select buffer and GL_SELECT. However, the last value in the select buffer is the x coordinate of the mouse on the screen. So I have two problems/questions

1. How does OpenGL know what objects are selected if its only looking at the x-coordinate.

2. The view of my window moves and there are other objects. How do I specify which ones are allowed to be selected and which ones aren't?

Can someone please 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!