pacman/scaling-lib/Scaling.mm

19 lines
425 B
Plaintext
Raw Normal View History

/*
This is an Objective C file to detect the window's
resolution scale on Apple platforms.
It is not a C++ file and is not part of this course!
*/
#import "AppKit/NSWindow.h"
#include <cassert>
2021-07-08 08:17:05 +00:00
#include "Scaling.hpp"
2021-07-08 08:17:05 +00:00
namespace pacman {
double scaling_factor_for_window(sf::WindowHandle) {
NSWindow* window = static_cast<NSWindow*>(ptr);
assert(window);
double d = [window backingScaleFactor];
return d;
2021-07-08 08:17:05 +00:00
}
}