Files
punchie-engine/include/AssetManager.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
793 B
C

#ifndef ASSET_MANAGER_H
#define ASSET_MANAGER_H
#include "Renderer.h"
#include "SDL_mixer.h"
#include "SDL_render.h"
#include "reusable_ids.h"
#include <stdint.h>
typedef enum {
ASSET_TYPE_IMAGE,
ASSET_TYPE_AUDIO_FX,
ASSET_TYPE_MUSIC,
ASSET_TYPE_COUNT
} AssetType;
typedef struct asset_manager AssetManager;
AssetManager *create_asset_manager();
AssetID load_asset_to_manager(AssetManager *am, const char *path,
AssetType type, Renderer *renderer);
void remove_asset_from_manager(AssetManager *am, AssetID id);
SDL_Texture *get_texture(AssetManager *am, AssetID id);
Mix_Chunk *get_audio_chunk(AssetManager *am, AssetID id);
Mix_Music *get_music(AssetManager *am, AssetID id);
void destroy_asset_manager(AssetManager *am);
#endif // !ASSET_MANAGER_H