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:
parent
ffd2ad656d
commit
1a9f9dd6a9
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue