diff options
| author | Preston Pan <preston@nullring.xyz> | 2023-02-06 19:44:28 -0800 |
|---|---|---|
| committer | Preston Pan <preston@nullring.xyz> | 2023-02-06 19:44:28 -0800 |
| commit | 78b8db870a20df98fdeb7d9ef80835895f716714 (patch) | |
| tree | 9bee539fcf35abdef0d3d43e54457b7190fe8e38 | |
| parent | 3088717fca8571c3078ed0d35c11849cabe0799e (diff) | |
add more files
| -rw-r--r-- | tetris.c | 25 | ||||
| -rw-r--r-- | tetris.h | 4 |
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 |
