From 2fee408d6fe0964e245dc0bae90027baa13b159a Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Wed, 11 May 2022 19:22:08 +1000 Subject: Improve plugin loading architecture This should be better, maybe the variable names could be better though. Init is more extensible, we take in a 'board_data' struct on the plugin end that has everything it needs (mainly function pointers for now). Then, a 'board' struct is given back to the main Clak runtime, with everything it needs to know (again, mainly function pointers). It is a bit weird that the board is not stored with Clak but as a pointer to the dynamically loaded bit, but not sure. --- platform/platform.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'platform/platform.h') diff --git a/platform/platform.h b/platform/platform.h index fd9b9bb..a5e5db4 100644 --- a/platform/platform.h +++ b/platform/platform.h @@ -5,11 +5,14 @@ #include "../board/board.h" -bool load_board(char *board_name, fn_board_on_down *on_down, fn_board_on_down *on_up); +struct board *load_board(char *board_name); + bool sound_init(float volume); void sound_play(unsigned char *buffer); + void keyboard_unhook(void); bool keyboard_hook(void); + void enter_idle(void); #endif /* CLAK_PLATFORM_H_ */ \ No newline at end of file -- cgit