I was going to use
GetInput()
for this code but I have to use something different instead. pollEvent gives me these errors:
error C2664: 'sf::Window::pollEvent' : cannot convert parameter 1 from 'int' to 'sf::Event &'
error C2664: 'sf::Window::pollEvent' : cannot convert parameter 1 from 'int' to 'sf::Event &'
The code is:
int x = camera->GetPosition().x + window->pollEvent(sf::Mouse::getPosition().x);
int y = camera->GetPosition().y + window->pollEvent(sf::Mouse::getPosition().y);
Thanks!
sf::Window::pollEvent()takes an argument of typeEvent& event, but you’re trying to passsf::Mouse::getPosition().x/y. I have no clue why you’re callingwindow->pollEvent()at all, and from what it looks like you’re trying to do, you can just remove the function call and addsf::Mouse::getPosition().x/ydirectly.Edit: Based on your comment, it looks like you want to something more like this: