im trying to see if the cursor is inside my game not on the menue or the border inside the game. i don’t konw what function should i use? i thought of using GetcursorPos() but is there better function?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
GetCursorPos() returns the mouse position. ScreenToClient() is usually next. That works for polling the mouse.
A more typical approach in a game loop is calling PeekMessage() inside the loop so you can see the WM_MOUSEMOVE message. More efficient because you don’t burn any time worrying about the mouse when the user isn’t moving it. Or using some class library to implement the game, mouse handling is always part of it.