2022-06-29 15:27:06 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <ncurses.h>
|
2022-06-29 18:54:16 +00:00
|
|
|
#include <time.h>
|
2022-06-29 18:06:40 +00:00
|
|
|
#include "project/extras.h"
|
|
|
|
#include "project/utils/utils.h"
|
2022-06-29 10:19:02 -05:00
|
|
|
|
2022-06-29 15:52:19 +00:00
|
|
|
int main(int argc,char**argv) {
|
2022-06-29 18:54:16 +00:00
|
|
|
unsigned int frameCount = 0;
|
2022-06-29 15:41:52 +00:00
|
|
|
int rows,cols;
|
2022-06-29 18:54:16 +00:00
|
|
|
clock_t lastTime = clock();
|
|
|
|
int FRAMETIME = CLOCKS_PER_SEC/60;
|
2022-06-29 15:41:52 +00:00
|
|
|
|
2022-06-29 15:27:06 +00:00
|
|
|
initscr();
|
2022-06-29 17:14:30 +00:00
|
|
|
start_color();
|
|
|
|
init_pair(1,COLOR_RED,COLOR_BLACK);
|
2022-06-29 15:41:52 +00:00
|
|
|
getmaxyx(stdscr,rows,cols);
|
2022-06-29 18:54:16 +00:00
|
|
|
cbreak();
|
2022-06-29 15:32:57 +00:00
|
|
|
keypad(stdscr,TRUE);
|
2022-06-29 18:54:16 +00:00
|
|
|
nodelay(stdscr,TRUE);
|
2022-06-29 15:32:57 +00:00
|
|
|
noecho();
|
|
|
|
|
2022-06-29 18:54:16 +00:00
|
|
|
|
2022-06-29 15:27:06 +00:00
|
|
|
refresh();
|
2022-06-29 18:54:16 +00:00
|
|
|
int ch = getch(); //410 is used when resizing the window.
|
|
|
|
getmaxyx(stdscr,rows,cols);
|
|
|
|
while (true) {
|
|
|
|
if (clock()-lastTime>FRAMETIME) {
|
|
|
|
mvprintw(5,7,"There are %dx%d squares. (%d)(%d)",rows,cols,frameCount++,getch());
|
|
|
|
refresh();
|
|
|
|
lastTime=clock();
|
|
|
|
}
|
|
|
|
}
|
2022-06-29 15:27:06 +00:00
|
|
|
getch();
|
|
|
|
endwin();
|
|
|
|
return 0;
|
|
|
|
}
|