Skip to content

Instantly share code, notes, and snippets.

@FRex
Created October 19, 2017 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FRex/83ab096bacb356afcf6fabd97f7ab841 to your computer and use it in GitHub Desktop.
Save FRex/83ab096bacb356afcf6fabd97f7ab841 to your computer and use it in GitHub Desktop.
#include <SFML/Graphics.hpp>
int main(int argc, char ** argv)
{
sf::RenderWindow app(sf::VideoMode(640u, 480u), "DoubleClick");
app.setFramerateLimit(60u);
while(app.isOpen())
{
sf::Event eve;
while(app.pollEvent(eve))
{
switch(eve.type)
{
case sf::Event::Closed:
app.close();
break;
case sf::Event::MouseButtonPressed:
std::printf("MousePress %d: %d\n", eve.mouseButton.button, eve.mouseButton.sequence);
break;
}//switch eve.type
}
app.clear();
app.display();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment