Files
punchie-engine/include/ObjectStore.h
T
abdelrahman 3f71cf0f3f Connected the AssetManager to the GameEngine and added function in the
GameEngine API to allow for loading and removing assets as well as rendering
textures using their AssetID
2022-09-23 04:39:17 +01:00

29 lines
936 B
C

#ifndef OBJECT_STORE_H
#define OBJECT_STORE_H
#include "Renderer.h"
#include "SDL_events.h"
#include "engine_build_config.h"
#include "reusable_ids.h"
typedef void (*EventHandlerPtr)(const SDL_Event *event, void *object);
typedef void (*UpdateFuncPtr)(float delta, void *object);
typedef void (*RenderFuncPtr)(void *object);
typedef struct object_store ObjectStore;
ObjectStore *create_object_store();
ObjectID add_object_to_store(ObjectStore *os, void *object, EventHandlerPtr eh,
UpdateFuncPtr uf, RenderFuncPtr rf);
void remove_object_from_store(ObjectStore *os, ObjectID id);
void handle_all_objects_events(ObjectStore *os, const SDL_Event *event);
void update_all_objects(ObjectStore *os, float delta);
void render_all_objects(ObjectStore *os);
void destroy_object_store(ObjectStore *os);
#ifdef DEBUG_ENGINE
void print_objects(ObjectStore *os);
#endif // !DEBUG_ENGINE
#endif // !OBJECT_STORE_H