summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tetris.c25
-rw-r--r--tetris.h4
2 files changed, 29 insertions, 0 deletions
diff --git a/tetris.c b/tetris.c
new file mode 100644
index 0000000..1321d5c
--- /dev/null
+++ b/tetris.c
@@ -0,0 +1,25 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <signal.h>
+
+#define UNUSED(x) (void)(x)
+
+volatile sig_atomic_t g_int_ctrl_c = 0;
+int score = 0;
+
+void interrupt_handler(int sig) {
+ UNUSED(sig);
+ g_int_ctrl_c = 1;
+}
+
+int main (int argc, char **argv) {
+ int width;
+ int height;
+
+ /* handle SIGINT interrupts */
+ signal(SIGINT, interrupt_handler);
+ /* Game Loop */
+ while (1) {
+ }
+ return 0;
+}
diff --git a/tetris.h b/tetris.h
new file mode 100644
index 0000000..b321186
--- /dev/null
+++ b/tetris.h
@@ -0,0 +1,4 @@
+#ifndef TETRIS_H
+#define TETRIS_H
+void interrupt_handler(int sig);
+#endif