windows.screens: Add word to get dpi on Windows.

windows-high-dpi
Doug Coleman 2018-03-14 13:02:42 -05:00
parent ef0f56e4b7
commit 40ef5594cb
3 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1 @@
windows

View File

@ -0,0 +1,11 @@
! Copyright (C) 2018 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types alien.data arrays classes.struct kernel
windows.errors windows.shcore windows.types windows.user32 ;
IN: windows.screens
: get-dpi ( -- dpi )
0 0 POINT <struct-boa> 0 MonitorFromPoint
MDT_EFFECTIVE_DPI
0 uint <ref> 0 uint <ref> [ GetDpiForMonitor win32-error=0/f ] 2keep
[ uint deref ] bi@ 2array ;