   [Super Noob]Getting Mouse Input
  Hi guys, yes a really easy question, well two actually.1. Is it best to get input via direct x through DirectInput or through other methods.2. What code do i need to allow me to get mouse input (buttons scroll and move) in both DirectInput and through other means.I presume other means are through windows.What includes, and basic example code would be nice.JamesCobras   
Quote:Original post by JamesCobrasHi guys, yes a really easy question, well two actually.1. Is it best to get input via direct x through DirectInput or through other methods.2. What code do i need to allow me to get mouse input (buttons scroll and move) in both DirectInput and through other means.I presume other means are through windows.What includes, and basic example code would be nice.JamesCobrasAs I understand it, DirectInput has been deprecated; Microsoft now recommend using the Windows message loop for events (assuming a typical PC application). Another option would be to use a cross-platform library such as SDL or SFML.If you need further advice, you might specify what programming language you're using and what platforms you're targeting.   ;  if you include windows.h all you need to do to get mouse coordinates isPOINT mouse;GetCursorPos(&mouse);mouse.x and mouse.yand in your windows message loop to check for clicks and coordinates something like this would workcase WM_RBUTTONDOWN:{POINT ptMouse;ptMouse.x=(int)LOWORD(lParam);ptMouse.y=(int)HIWORD(lParam);//do something with itRightMouseClick(ptMouse);}break;case WM_LBUTTONDOWN:{POINT ptMouse;ptMouse.x=(int)LOWORD(lParam);ptMouse.y=(int)HIWORD(lParam);//do something with itLeftMouseClick(ptMouse);}break;