summaryrefslogtreecommitdiff
path: root/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/screen.c b/screen.c
new file mode 100644
index 0000000..34b27f3
--- /dev/null
+++ b/screen.c
@@ -0,0 +1,24 @@
+#include <curses.h>
+
+#include "screen.h"
+
+WINDOW *screen_init(bool israw)
+{
+ WINDOW *screen = initscr();
+
+ if (israw)
+ raw();
+ noecho();
+ cbreak();
+ nodelay(screen, TRUE);
+ keypad(stdscr, TRUE);
+ refresh();
+ wrefresh(screen);
+
+ return screen;
+}
+
+void screen_end(void)
+{
+ endwin();
+}