Skip to content

Instantly share code, notes, and snippets.

@ngscheurich
Created July 14, 2012 21:02
Show Gist options
  • Save ngscheurich/3113348 to your computer and use it in GitHub Desktop.
Save ngscheurich/3113348 to your computer and use it in GitHub Desktop.
Detect mouse clicks using SFML
// @library SFML 2.0 RC
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
switch (event.type) {
case sf::Event::MouseButtonPressed:
cout << event.mouseButton.button << " button was clicked";
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment