aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-05-10 17:56:18 +0200
committerCharles <sircharlesaze@gmail.com>2020-05-10 18:06:37 +0200
commitcd1f7309aed360770bbfb33ed91fb6fd951b6f0a (patch)
tree4c8a045867281e3275d899a7b7cc2e7c535c91ba
parentf23764a0ec0b946d9d0c0dd1a2537c0d22849086 (diff)
downloadcardioid-cd1f7309aed360770bbfb33ed91fb6fd951b6f0a.tar.gz
cardioid-cd1f7309aed360770bbfb33ed91fb6fd951b6f0a.tar.bz2
cardioid-cd1f7309aed360770bbfb33ed91fb6fd951b6f0a.zip
Added gifHEADmaster
-rw-r--r--READMD.md3
-rw-r--r--README.md14
-rw-r--r--config.h2
-rw-r--r--graphics.c11
-rw-r--r--recording.gifbin0 -> 7103057 bytes
5 files changed, 21 insertions, 9 deletions
diff --git a/READMD.md b/READMD.md
deleted file mode 100644
index ecd3b66..0000000
--- a/READMD.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Cardioid
-
-Cardoid visualizer
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6f3fbff
--- /dev/null
+++ b/README.md
@@ -0,0 +1,14 @@
+# Cardioid
+
+Cardioid visualizer
+
+![recording](./recording.gif)
+
+# Usage
+
+- left/right arrow to decrese/increse the factor
+- up/down arrow to decrese/increse the number of points
+
+# Dependencies
+
+- [SDL2](https://libsdl.org)
diff --git a/config.h b/config.h
index 1347faa..970ca51 100644
--- a/config.h
+++ b/config.h
@@ -3,7 +3,7 @@
// # define LINE_COLOR 0x151515ff
// # define LINE_COLOR 0xb71c1cff
-# define LINE_COLOR 0x280000ff
+# define LINE_COLOR 0x280808ff
# define POINTS_STEP 1.0
# define FACTOR_STEP 0.01
diff --git a/graphics.c b/graphics.c
index 2d69c82..8020178 100644
--- a/graphics.c
+++ b/graphics.c
@@ -7,13 +7,13 @@
#ifdef CARDIOID_RELEASE
# define SDL_CALL(x) x
#else
-# define SDL_CALL(x) \
- SDL_ClearError(); \
- x; \
+# define SDL_CALL(x) \
+ SDL_ClearError(); \
+ x; \
if (*SDL_GetError() != '\0') { \
- SDL_Log("[ERROR SDL] %s at %s:%d\n\t"#x, \
+ SDL_Log("[ERROR SDL] %s at %s:%d\n\t"#x, \
SDL_GetError(), __FILE__, __LINE__); \
- exit(EXIT_FAILURE); \
+ exit(EXIT_FAILURE); \
}
#endif
@@ -141,6 +141,7 @@ static void event_handler(t_state *state)
break;
case SDL_WINDOWEVENT:
+ /* printf("%d\n", e.window.windowID); */
if (e.window.event == SDL_WINDOWEVENT_RESIZED)
update_window_value(state, e.window.data1, e.window.data2);
}
diff --git a/recording.gif b/recording.gif
new file mode 100644
index 0000000..5f37f5a
--- /dev/null
+++ b/recording.gif
Binary files differ