1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-05-12 12:00:14 +00:00

Update libqb.cpp

Add support for _Width and _Height in Linux and Mac when _Dest is Console.
This commit is contained in:
visionmercer 2023-01-02 18:10:11 +01:00
parent ffd2ad656d
commit 1a9f9dd6a9

View file

@ -145,6 +145,7 @@ void setbits(uint32 bsize,uint8 *base,ptrszint i,int64 val){
#ifdef QB64_UNIX
#include <pthread.h>
#include <libgen.h> //required for dirname()
#include <sys/ioctl.h> //required for terminal width and height
#endif
#ifdef QB64_LINUX
@ -19084,6 +19085,13 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
return cl_bufinfo.srWindow.Right - cl_bufinfo.srWindow.Left + 1;
}
#endif
#ifdef QB64_UNIX
if ((read_page->console && !passed)||i==console_image){
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
return w.ws_col;
}
#endif
if (passed){
if (i>=0){//validate i
@ -19114,6 +19122,13 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
return cl_bufinfo.dwMaximumWindowSize.Y;
}
#endif
#ifdef QB64_UNIX
if ((read_page->console && !passed)||i==console_image){
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
return w.ws_row;
}
#endif
if (passed){
if (i>=0){//validate i