I'm trying to understand what's going on with the mouse position on OSX.
I have the following function:
Vector2 InputManager::getMousePosition(Camera *camera)
{
sf::Vector2i pos = sf::Mouse::getPosition(*window);
sf::Vector2f worldPos = window->mapPixelToCoords(pos, camera->view);
return Vector2(worldPos.x, worldPos.y);
}
The value of "pos", when I click near the top left position is (-428, 554) and I can't figure out what those values mean.
The window is positioned in the middle of the screen and the size is 320, 240.
I have a similar function for touches that I use with iOS and it works perfectly instead:
Vector2 InputManager::getTouchPosition(unsigned int finger, Camera *camera)
{
sf::Vector2i pos = sf::Touch::getPosition(finger, *window);
sf::Vector2f worldPos = window->mapPixelToCoords(pos, camera->view);
return Vector2(worldPos.x, worldPos.y);
}
Is that a known bug? (Using SFML 2.3.2)
Thanks!