views:

57

answers:

1

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?

+2  A: 

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.

Hans Passant