Added DPI awareness option.

This commit is contained in:
Brad Nelson
2022-03-26 11:03:29 -07:00
parent 1b09f7a2b0
commit 25c7397dbd
3 changed files with 11 additions and 1 deletions

View File

@ -14,6 +14,7 @@
\ See the License for the specific language governing permissions and
\ limitations under the License.
windows dpi-aware
also graphics
also structures
@ -21,7 +22,7 @@ struct ScanSpan
ptr field ->next
ptr field ->edge
1024 constant max-scanlines
2048 constant max-scanlines
create scanlines max-scanlines cells allot
scanlines max-scanlines cells erase
0 value free-edges

View File

@ -27,6 +27,7 @@ windows
does> dup @ swap cell+ @ execute ;
: dll ( z "name" -- )
LoadLibraryA dup 0= throw create , does> @ sofunc ;
: contains? ( z 'lib -- f ) >body @ swap GetProcAddress ;
z" Kernel32.dll" dll Kernel32

View File

@ -170,4 +170,12 @@ IDI_ASTERISK constant IDI_INFORMATION
18 constant VK_ALT
( Check for Windows 10 DPI awareness )
z" SetThreadDpiAwarenessContext" ' User32 contains? [IF]
z" SetThreadDpiAwarenessContext" 1 User32 SetThreadDpiAwarenessContext
: dpi-aware -2 SetThreadDpiAwarenessContext drop ;
[ELSE]
: dpi-aware ;
[THEN]
only forth definitions