Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Mouse::getPosition() report wrong on Mac  (Read 1100 times)

0 Members and 1 Guest are viewing this topic.

jlamb

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Mouse::getPosition() report wrong on Mac
« on: September 18, 2018, 06:13:37 pm »
When I use Mouse::getPosition() to get the current x and y desktop coordinates the y-coordinate is always reporting one height worth of pixels too much. I am running a Macbook Pro, early 2015 with retina display (2560x1600 resolution) with an Intel Iris 6100 graphics chip.
Mac OS 10.13.6 with SFML 2.5 using VIM as IDE under iTerm2.

Using the code below, and putting my mouse at the top of the screen it reports 1600 (instead of the expected 0) and if I run the same with the mouse at the bottom of the screen it reports 3200.

#include <SFML/Graphics.hpp>
#include <iostream>

using namespace sf;

int main() {
  std::cout<<sf::Mouse::getPosition().y << std::endl;
}

I have no external displays, I have even tried turning off extra desktop spaces.
Have anyone encountered this or have any ideas what I could try?