Jump to content
  • Advertisement
Sign in to follow this  
Mantear

How often to pick

This topic is 4859 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

Greetings, I've been working on the GUI for my program, and came across something I'm sure others have delt with before. Several different mouse events can cause actions to take place. In my case, a left mouse click causes the picking scene to be rendered and then processed. If the mouse click is being held down and the mouse moves, again the picking scene is rendered, but a different processing function is called to handle what should happen on a click held + mouse move. However, if I go just based off of mouse movement messages from the Windows message callback, I feel like I'm rendering the picking scene far too many times. However, if I don't do that and put some minimum time between rending of the picking scene, I could miss the user dragging the mouse over something. I have very, very few items being drawn right now, so the drop in FPS is most likely missleading (I'm probably taking the largest hit just switching rendering modes). But I thought I'd see how others handle such things. Thanks for any input.

Share this post


Link to post
Share on other sites
Advertisement
It would be good to organise it so that you only need to pick when you get a mousedown event. Is there some reason you need to render the picking scene when mouse button is already down and the mouse moves?

Share this post


Link to post
Share on other sites
Yes. If the user clicks down, dragging the mouse over items while the click is held down can also select items.

Share this post


Link to post
Share on other sites
gluPickMatrix(..) or pickregion or something lets u define a onscreen rectange to select objects within

Share this post


Link to post
Share on other sites
I want it to be interactive/realtime. If the user clicks on an object and holds, then moves the mouse over other objects, it needs to respond. A quick example would be selecting multiple objects at once. So I can't just define a region and process a single picking event.

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!