testing on linux

This commit is contained in:
2025-01-29 10:51:20 -08:00
parent 569ea396c0
commit 58d3ec9e71
8 changed files with 50 additions and 12 deletions

21
source/term.c Normal file
View 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;
}