winapi - How to get the x,y coordinate of a mouse-click with win32 C++ on a directx object? -


Text after "

How can I get X, Y coordinate a mouse click, if it's done by DirectX my menu button is over Have been to see? Currently, my codebase does not seem to be able to give this..I'm not related to the following mouse related class that I'm sure how it can work.

  InputMouse :: InputMouse (): M_LastX (-1), M_List (-1) {m_MouseActionEvent.clear (); } InputMouse :: ~ InputMouse () {} zero InputMouse :: PostUpdate () {m_CurrentAction.clear (); } Bool InputMouse :: IsEventTriggered (for integer eventNumber) {for (unsigned int i = 0; I & lt; m_CurrentAction.size (); i ++) {if (m_MouseActionEvent.size ()> 0 & amp; Amp; m_MouseActionEvent [m_CurrentAction [i]] == eventNumber) {back true; }     }     return false; } Zero InputMouse :: AddInputEvent (int action, int eventNumber) {m_MouseActionEvent [action] = eventNumber; } Zero InputMouse :: SetMouseMouse (int x, int y) {if (m_LastX = -1!) {If (x> m_LastX) {m_CurrentAction.push_back (MOUSE_RIGHT); } And if (x & lt; m_LastX) {m_CurrentAction.push_back (MOUSE_LEFT); } If (y> m_LastY) {m_CurrentAction.push_back (MOUSE_UP); } And if (y & lt; m_LastY) {m_CurrentAction.push_back (MOUSE_DOWN); }} M_LastX = x; M_LastY = y; }  

Your menu buttons are 2D, as remembering this screen Coordination should be made simple to use for your buttons.

If you are trying to determine which one click reaches a 3D object that has been sung, then the technique you are seeing is called, then select

  • A simple Google comes with some good results:

  • < P> Actually, in this technique involves clicking the mouse in a ray in the scene. For a menu item, a simple bounding box may be sufficient enough to determine 'hit'.


    Comments

    Popular posts from this blog

    c# - How to capture HTTP packet with SharpPcap -

    php - Multiple Select with Explode: only returns the word "Array" -

    php - jQuery AJAX Post not working -