From 1437dd98c82521659f3d5c8099aace2ffdaf6d80 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Wed, 1 Aug 2018 22:38:21 -0300 Subject: [PATCH] Uses GetSystemMetrics to return _DESKTOPWIDTH/HEIGHT in $CONSOLE:ONLY mode. Windows-only. Partially addresses and closes #58 --- internal/c/libqb.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 8d7a71c8c..652295409 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -20539,7 +20539,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ }//sub__icon #endif //DEPENDENCY_ICON - + int32 func_screenwidth () { #ifdef QB64_GLUT while (!window_exists){Sleep(100);} @@ -20547,11 +20547,15 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ while (!window_handle){Sleep(100);} #endif return glutGet(GLUT_SCREEN_WIDTH); + #else + #ifdef QB64_WINDOWS + return GetSystemMetrics(0); #else - return 0; + return 0; + #endif #endif } - + int32 func_screenheight () { #ifdef QB64_GLUT while (!window_exists){Sleep(100);} @@ -20559,11 +20563,15 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ while (!window_handle){Sleep(100);} #endif return glutGet(GLUT_SCREEN_HEIGHT); + #else + #ifdef QB64_WINDOWS + return GetSystemMetrics(1); #else - return 0; + return 0; + #endif #endif } - + void sub_screenicon () { #ifdef QB64_GLUT while (!window_exists){Sleep(100);}