Hello, I'm creating a Mapeditor and now I need sf::Mouse::isButtonPressed(sf::Mouse::Button::Left). The Problem is, even when i press the left mousebutton, the method returns false. I don't know why this happens but it happens on the smallest example too. So it may be a bug in SFML or am I doing something wrong?
I compiled SFML 2.2 static on Linux with GCC 4.9.2 64bit, if this Information helps.
Thanks for your help.
Even on this small example it happens:
#include <iostream>
#include <SFML/Graphics.hpp>
int main(int argc, char **argv) {
sf::RenderWindow window(sf::VideoMode(800, 600, 32), "Example", sf::Style::Close);
window.setFramerateLimit(60.f);
while(window.isOpen()) {
sf::Event event;
while(window.pollEvent(event)) {
switch(event.type) {
case sf::Event::Closed:
window.close();
break;
default:
break;
}
}
if(sf::Mouse::isButtonPressed(sf::Mouse::Button::Left))
std::cout << "Hello left button" << std::endl;
window.clear();
window.display();
}
return 0;
}