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:
Comments
Post a Comment