SDL Mouse Input
Can anyone tell me how to get Mouse Input with SDL? Any tips or tutorial links would be greatly appreciated.
My Current Project Angels 22 (4E5)
while (SDL_PollEvent(&event)) // goes through until done with each event{ switch (event.type) // differ the types of events { case SDL_MOUSEBUTTONUP: // mouse button is up break; case SDL_MOUSEBUTTONDOWN: // see which mouse buttons were hit if(SDL_GetMouseState(null, null)&SDL_BUTTON_LMASK) // left mouse down if(SDL_GetMouseState(null, null)&SDL_BUTTON_MMASK) // middle mouse down if(SDL_GetMouseState(null, null)&SDL_BUTTON_RMASK) // right button down break; case SDL_MOUSEMOTION: mouseX = event.button.x; mouseY = event.button.y; break; } // switch} // while
SDL Doc Project
SDL Doc Wiki
Clickomania! Tutorial
[Edited by - clayasaurus on March 12, 2005 5:04:28 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement