1
System / Re: Problem with MouseButtonPressed
« on: June 12, 2020, 08:23:06 pm »
I fixed the problem, it was necessary to put this code in the event loop. As a result, I have this:
Event event;
while(window.pollEvent(event))
{
if (event.type == Event::Closed)
{
window.close();
}
if (event.type == Event::MouseButtonPressed)
{
if (event.mouseButton.button == Mouse::Left)
{
//Some code
}
}
}
Event event;
while(window.pollEvent(event))
{
if (event.type == Event::Closed)
{
window.close();
}
if (event.type == Event::MouseButtonPressed)
{
if (event.mouseButton.button == Mouse::Left)
{
//Some code
}
}
}