mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-08 16:56:49 +02:00
byuu says: - bsnes: added video filters from bsnes v082 - bsnes: added ZSNES snow effect option when games paused or unloaded (no, I'm not joking) - bsnes: added 7-zip support (LZMA 19.00 SDK) [Recent higan WIPs have also mentioned bsnes changes, although the higan code no longer includes the bsnes code. These changes include: - higan, bsnes: added EXLOROM, EXLOROM-RAM, EXHIROM mappings - higan, bsnes: focus the viewport after leaving fullscreen exclusive mode - bsnes: re-added mightymo's cheat code database - bsnes: improved make install rules for the game and cheat code databases - bsnes: delayed construction of hiro::Window objects to properly show bsnes window icons - Ed.]
28 lines
836 B
C++
28 lines
836 B
C++
#if defined(Hiro_Monitor)
|
|
struct Monitor {
|
|
Monitor() = delete;
|
|
|
|
static auto count() -> uint;
|
|
static auto dpi(maybe<uint> monitor = nothing) -> Position;
|
|
static auto geometry(maybe<uint> monitor = nothing) -> Geometry;
|
|
static auto primary() -> uint;
|
|
static auto workspace(maybe<uint> monitor = nothing) -> Geometry;
|
|
};
|
|
|
|
//DPI scale X
|
|
inline auto sx(float x) -> float {
|
|
//round DPI scalar to increments of 0.5 (eg 1.0, 1.5, 2.0, ...)
|
|
static auto scale = round(Monitor::dpi().x() / 96.0 * 2.0) / 2.0;
|
|
return x * scale;
|
|
}
|
|
|
|
//DPI scale y
|
|
inline auto sy(float y) -> float {
|
|
static auto scale = round(Monitor::dpi().y() / 96.0 * 2.0) / 2.0;
|
|
return y * scale;
|
|
}
|
|
|
|
inline auto operator"" _sx(unsigned long long x) -> float { return sx(x); }
|
|
inline auto operator"" _sy(unsigned long long y) -> float { return sy(y); }
|
|
#endif
|