diff options
author | untir_l <87096069+untir-l@users.noreply.github.com> | 2022-06-11 15:43:23 +0000 |
---|---|---|
committer | untir_l <87096069+untir-l@users.noreply.github.com> | 2022-06-11 15:49:12 +0000 |
commit | 2aa35e2c108f954949ec001f1e33846379e7cc98 (patch) | |
tree | 1653252d1419d01b7347a70f47416ae45d4fb2c4 /web/hitomezashi_web.h | |
parent | e0babc53b16ef49ff40db21bbc4326e6e23185fa (diff) | |
download | hitomezashi-2aa35e2c108f954949ec001f1e33846379e7cc98.tar hitomezashi-2aa35e2c108f954949ec001f1e33846379e7cc98.tar.gz hitomezashi-2aa35e2c108f954949ec001f1e33846379e7cc98.zip |
Web: canvas now updates on the fly based on input
Also some other minor changes to thw web README.md and the Makefile, and
making some stuff const where they weren't throughout the lib/ tree as well.
Diffstat (limited to 'web/hitomezashi_web.h')
-rw-r--r-- | web/hitomezashi_web.h | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/web/hitomezashi_web.h b/web/hitomezashi_web.h index 361a8c2..c7db1c9 100644 --- a/web/hitomezashi_web.h +++ b/web/hitomezashi_web.h @@ -5,32 +5,13 @@ #include "SDL2/SDL.h" #include "emscripten.h" -enum Hitomezashi_Web_Result { - Hitomezashi_Web_Result_Success = 0, - Hitomezashi_Web_Result_Err_Get_Params = 1, - Hitomezashi_Web_Result_Err_Sdl_Init = 2, - Hitomezashi_Web_Result_Err_State_Init = 3, -}; +void main_loop(void); -int hitomezashi_web(int x_pattern_len, int y_pattern_len, char *x_pattern, - char *y_pattern, int gap, int line_thickness, - Uint32 fg_colour, Uint32 bg_colour); - -/** Parse the URL query string and return the parameters thereof. - * - * This is implemented in JS with EM_JS, in order to access the query string. - * The friction of interoperation is the reason for turning the query string - * into a different string that the C code must parse to the actual values, - * rather than sending the data back individually with the correct types. - * That is probably possible, but it seems unpleasant. - * - * The query string's x_pattern, y_pattern, gap, and line_thickness are - * parsed. If not all of them are present, "i" is returned. If x_pattern or - * y_pattern in the query string have characters other than ASCII digits 0 - * and 1, "i" is returned. Otherwise, the values are returned as a - * newline-delimited string in the order x_pattern, y_pattern, gap, - * line_thickness. - */ -char *hitomezashi_web_get_args(void); +char *hitomezashi_web_get_x_pattern(void); +char *hitomezashi_web_get_y_pattern(void); +unsigned int hitomezashi_web_get_gap(void); +unsigned int hitomezashi_web_get_line_thickness(void); +Uint32 hitomezashi_web_get_fg_colour(void); +Uint32 hitomezashi_web_get_bg_colour(void); #endif // HITOMEZASHI_WEB_H |