about summary refs log tree commit diff stats
path: root/cpp/070console
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/070console')
-rw-r--r--cpp/070console34
1 files changed, 34 insertions, 0 deletions
diff --git a/cpp/070console b/cpp/070console
new file mode 100644
index 00000000..18faffb6
--- /dev/null
+++ b/cpp/070console
@@ -0,0 +1,34 @@
+//: Text-mode cursor primitives. Currently thin wrappers around ncurses calls.
+
+:(before "End Includes")
+#include<ncurses.h>
+
+:(before "End Primitive Recipe Declarations")
+CONSOLE_MODE,
+:(before "End Primitive Recipe Numbers")
+Recipe_number["console-mode"] = CONSOLE_MODE;
+:(before "End Primitive Recipe Implementations")
+case CONSOLE_MODE: {
+  initscr();
+  break;
+}
+
+:(before "End Primitive Recipe Declarations")
+RETRO_MODE,
+:(before "End Primitive Recipe Numbers")
+Recipe_number["retro-mode"] = RETRO_MODE;
+:(before "End Primitive Recipe Implementations")
+case RETRO_MODE: {
+  endwin();
+  break;
+}
+
+:(before "End Primitive Recipe Declarations")
+WAIT_FOR_KEY,
+:(before "End Primitive Recipe Numbers")
+Recipe_number["wait-for-key"] = WAIT_FOR_KEY;
+:(before "End Primitive Recipe Implementations")
+case WAIT_FOR_KEY: {
+  getch();
+  break;
+}