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
This commit is contained in:
1 parent
c4f1775392
commit
3f71cf0f3f
11 files changed
+156
-33
No files matched your search
+10
-3
@@ -1,9 +1,12 @@
|
||||
#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 int32_t AssetID;
|
||||
typedef enum {
|
||||
ASSET_TYPE_IMAGE,
|
||||
ASSET_TYPE_AUDIO_FX,
|
||||
@@ -14,8 +17,12 @@ typedef enum {
|
||||
typedef struct asset_manager AssetManager;
|
||||
|
||||
AssetManager *create_asset_manager();
|
||||
AssetID load_asset(AssetManager *am, const char *path, AssetType type);
|
||||
void close_asset(AssetManager *am, AssetID id);
|
||||
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
|
||||
Reference in new issue
Block a user