summaryrefslogtreecommitdiff
path: root/src/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.c')
-rw-r--r--src/draw.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/draw.c b/src/draw.c
new file mode 100644
index 0000000..75d4dbe
--- /dev/null
+++ b/src/draw.c
@@ -0,0 +1,23 @@
+#include <curses.h>
+#include <signal.h>
+
+#include "draw.h"
+
+void tui_init() {
+ int input; // capture user input
+
+ // set an interrupt to end cleanly
+ signal(SIGINT, tui_end);
+
+ // init and set options
+ initscr();
+ keypad(stdscr, TRUE); // enable arrow keys and other function keys
+ cbreak(); // set for interactive curses applications
+
+ input = getch();
+ tui_end();
+}
+
+void tui_end() {
+ endwin();
+}