testing on linux
This commit is contained in:
21
source/term.c
Normal file
21
source/term.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "term.h"
|
||||
#include "../includes/tart.h"
|
||||
|
||||
|
||||
// windows only
|
||||
#include <Windows.h>
|
||||
struct tart_vec2 term_current_size() {
|
||||
struct tart_vec2 ret;
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
||||
unsigned int rows = (csbi.srWindow.Right - csbi.srWindow.Left + 1);
|
||||
unsigned int cols = (csbi.srWindow.Bottom - csbi.srWindow.Top + 1);
|
||||
|
||||
unsigned short max_short = 0XFFFF;
|
||||
if(rows < max_short && cols < max_short) {
|
||||
|
||||
ret = (struct tart_vec2){(unsigned short) rows ,(unsigned short) cols};
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user