Started implementing a hashmap that includes tags for the all the game
objects.
This commit is contained in:
1 parent
6b1197bfca
commit
20f476c4ab
7 files changed
+196
-3
No files matched your search
@@ -2,12 +2,20 @@
|
||||
#define OBJECT_STORE_H
|
||||
|
||||
#include "Renderer.h"
|
||||
#include "SDL_events.h"
|
||||
|
||||
typedef void (*EventHandlerPtr)(const SDL_Event *event, void *object);
|
||||
typedef void (*UpdateFuncPtr)(float delta, void *object);
|
||||
typedef void (*RenderFuncPtr)(Renderer *renderer, void *object);
|
||||
|
||||
typedef struct object_store ObjectStore;
|
||||
|
||||
void add_object_to_store(ObjectStore *os, UpdateFuncPtr uf, RenderFuncPtr rf);
|
||||
void add_object_to_store(ObjectStore *os, const char *object_tag,
|
||||
EventHandlerPtr eh, UpdateFuncPtr uf,
|
||||
RenderFuncPtr rf);
|
||||
void handle_all_object_events(ObjectStore *os);
|
||||
void update_all_objects(ObjectStore *os);
|
||||
void render_all_objects(ObjectStore *os);
|
||||
void remove_object_from_store(ObjectStore *os, const char *object_tag);
|
||||
|
||||
#endif // !OBJECT_STORE_H
|
||||
Reference in new issue
Block a user