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

Author Topic: Window size on OS X & Retina display  (Read 2825 times)

0 Members and 1 Guest are viewing this topic.

verbrannt

  • Newbie
  • *
  • Posts: 10
    • View Profile
Window size on OS X & Retina display
« on: January 26, 2015, 05:02:26 pm »
Hi.

Tested on 2.2 (from sources) & github master.

Code below makes window with size 400x300:

sf::Window window(sf::VideoMode(800, 600), "My window");

Of course in real (hardware) pixels it have normal size (800x600 real pixels), but by default OS X scales resolution. Same problem with sprites & other.

So can the SFML detect that need to scale all sizes automatically when i run app on retina display and non-retina display?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Window size on OS X & Retina display
« Reply #1 on: January 26, 2015, 05:31:54 pm »
Set `High Resolution Capable` in your application plist file to `No` if you don't want this scaling.
SFML / OS X developer

verbrannt

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Window size on OS X & Retina display
« Reply #2 on: January 26, 2015, 05:58:25 pm »
It works, thank you!
But now window title looks horrible.

May be exists some method, that returns OS scale modifier? Eg for OS X & Retina modifier = 2, on non-retina is 1, and i just multiply all sizes in my app by this modifier (or if it = 2, load HD images)?
« Last Edit: January 26, 2015, 06:06:12 pm by verbrannt »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML / OS X developer