Added support for desktop full screen with pillarboxing and letterboxing

and started adding some comments to the code
This commit is contained in:
abdelrahman committed 2022-10-02 02:16:28 +01:00
1 parent ffaa6e5ae7
commit e110b1f2fd
10 files changed
+351 -77

No files matched your search

+24
View File
@@ -22,14 +22,38 @@ typedef enum {
} AssetType;
typedef struct asset_manager AssetManager;
/**
* Attempts to allocate an AssetManager object on the heap.
*
* Returns the pointer to the object when it succeeds, or NULL if it fails.
*/
AssetManager *create_asset_manager();
/**
* Attempts to load an asset to the manager from a file path.
*
* Returns the AssetID on success or an INVALID_ID in the case of failure.
*/
AssetID load_asset_to_manager(AssetManager *am, const char *path,
AssetType type, Renderer *renderer);
/**
* Removes an asset from the manager using its ID.
*
* Does nothing if the ID is not valid.
*/
void remove_asset_from_manager(AssetManager *am, AssetID *id_ptr);
SDL_Texture *get_texture(AssetManager *am, AssetID id);
TTF_Font *get_font(AssetManager *am, AssetID id);
Mix_Chunk *get_audio_chunk(AssetManager *am, AssetID id);
Mix_Music *get_music(AssetManager *am, AssetID id);
/**
* Frees the memory allocated to the AssetManager object and performs the
* necessary cleanup to free all memory that were allocated to the loaded
* assets.
*/
void destroy_asset_manager(AssetManager **am);
#ifdef __cplusplus