Added DPI awareness option.
This commit is contained in:
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user