-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
55 lines (43 loc) · 1.06 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <curses.h>
#include <stdlib.h>
#include <math.h>
#include "headers/screen.h"
#define MAIN_SCR_H 50
#define MAIN_SCR_W 100
#define MAIN_SCR_Y 1
#define MAIN_SCR_X 1
#define SIDEBAR_H 50
#define SIDEBAR_W 20
#define SIDEBAR_Y 1
#define SIDEBAR_X MAIN_SCR_W+1
int main(int argc, char** argv){
//Initialise ncurses
initscr();
cbreak();
raw();
noecho();
start_color();
//Initialise colours
init_pair(1,0,0); //FG: black, BG: black
init_pair(2,9,9); //FG: red, BG: red
init_pair(3,12,12); //FG: blue, BG: blue
init_pair(4, 13, 13);
init_pair(5, 15, 15);
Screen *s = screen_create(MAIN_SCR_H, MAIN_SCR_W, MAIN_SCR_Y, MAIN_SCR_X);
Screen *s2 = screen_create(SIDEBAR_H, SIDEBAR_W , SIDEBAR_Y, SIDEBAR_X);
refresh();
screen_fill(s, ".", 2);
screen_wave(s, ".", sin, 3, 15, 0.1);
screen_wave(s, ".", cos, 4, 15, 0.1);
wrefresh(s->win);
screen_fill(s2, ".", 3);
screen_fill_randomly(s2, 1422341, ".", 2, 50);
wrefresh(s2->win);
refresh();
//Cleanup and quit
free(s);
free(s2);
getch();
endwin();
return EXIT_SUCCESS;
}