summaryrefslogtreecommitdiff
path: root/hitomezashi.h
diff options
context:
space:
mode:
authoruntir_l <87096069+untir-l@users.noreply.github.com>2022-02-18 10:15:06 +0000
committeruntir_l <87096069+untir-l@users.noreply.github.com>2022-02-18 10:15:06 +0000
commitc73c5ba7f5fcd78fc68417f500dbfac0f228f52a (patch)
treeb2e0fc5fc7d9ba3ece4e3003b0485086f5950033 /hitomezashi.h
downloadhitomezashi-c73c5ba7f5fcd78fc68417f500dbfac0f228f52a.tar
hitomezashi-c73c5ba7f5fcd78fc68417f500dbfac0f228f52a.tar.gz
hitomezashi-c73c5ba7f5fcd78fc68417f500dbfac0f228f52a.zip
Initial commit
Diffstat (limited to 'hitomezashi.h')
-rw-r--r--hitomezashi.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/hitomezashi.h b/hitomezashi.h
new file mode 100644
index 0000000..acd8ab9
--- /dev/null
+++ b/hitomezashi.h
@@ -0,0 +1,46 @@
+#ifndef HITOMEZASHI_HITOMEZASHI_H
+#define HITOMEZASHI_HITOMEZASHI_H
+
+#include "SDL.h"
+
+struct Hitomezashi_State {
+ int x_pattern_len;
+ int y_pattern_len;
+
+ char *x_pattern;
+ char *y_pattern;
+
+ int gap;
+
+ int line_thickness;
+
+ int output_width;
+ int output_height;
+
+ SDL_Surface *surface;
+};
+
+enum Hitomezashi_State_Init_Result {
+ Hitomezashi_State_Init_Result_Success,
+ Hitomezashi_State_Init_Result_Err_Create_Surface,
+};
+
+
+enum Hitomezashi_Draw_Result {
+ Hitomezashi_Draw_Result_Success,
+ Hitomezashi_Draw_Result_Err_Lock_Surface,
+};
+
+
+enum Hitomezashi_State_Init_Result
+hitomezashi_state_init(
+ struct Hitomezashi_State *state,
+ int x_pattern_len, int y_pattern_len,
+ char *x_pattern, char *y_pattern,
+ int gap, int line_thickness);
+
+
+enum Hitomezashi_Draw_Result
+hitomezashi_draw(struct Hitomezashi_State *state);
+
+#endif // HITOMEZASHI_HITOMEZASHI_H