|
|
|
@ -1,34 +1,35 @@ |
|
|
|
|
#include <stdlib.h> |
|
|
|
|
#include <ncurses.h> |
|
|
|
|
#include <time.h> |
|
|
|
|
#include "project/extras.h" |
|
|
|
|
#include "project/utils/utils.h" |
|
|
|
|
|
|
|
|
|
int main(int argc,char**argv) { |
|
|
|
|
unsigned int frameCount = 0; |
|
|
|
|
int rows,cols; |
|
|
|
|
clock_t lastTime = clock(); |
|
|
|
|
int FRAMETIME = CLOCKS_PER_SEC/60; |
|
|
|
|
|
|
|
|
|
initscr(); |
|
|
|
|
start_color(); |
|
|
|
|
init_pair(1,COLOR_RED,COLOR_BLACK); |
|
|
|
|
getmaxyx(stdscr,rows,cols); |
|
|
|
|
raw(); |
|
|
|
|
cbreak(); |
|
|
|
|
keypad(stdscr,TRUE); |
|
|
|
|
nodelay(stdscr,TRUE); |
|
|
|
|
noecho(); |
|
|
|
|
addch(ACS_BULLET); |
|
|
|
|
addch(ACS_BOARD); |
|
|
|
|
addch(ACS_CKBOARD); |
|
|
|
|
addch(ACS_BBSS); |
|
|
|
|
addch(ACS_BLOCK); |
|
|
|
|
addch(ACS_BSBS); |
|
|
|
|
addch(ACS_BTEE); |
|
|
|
|
addch(' '); |
|
|
|
|
writeExtras(); |
|
|
|
|
testReach(); |
|
|
|
|
mvaddch(5,17,ACS_DARROW); |
|
|
|
|
|
|
|
|
|
attron(COLOR_PAIR(1)); |
|
|
|
|
mvprintw(4,7,"There are %dx%d squares.",rows,cols); |
|
|
|
|
attroff(COLOR_PAIR(1)); |
|
|
|
|
|
|
|
|
|
refresh(); |
|
|
|
|
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(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
getch(); |
|
|
|
|
endwin(); |
|
|
|
|
return 0; |
|
|
|
|