Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
memory.h
Go to the documentation of this file.
1#ifndef MEMORY_H
2#define MEMORY_H
3
24typedef struct ModelData ModelData;
26typedef unsigned int Shader;
27
33typedef struct {
35 char textureName[6][100];
37
43typedef struct {
45 char textureName[100];
47
53typedef struct {
55 char modelName[100];
57
63typedef struct {
65 char shaderName[2][100];
67
73typedef struct {
74 Mix_Music *music;
75 char musicName[100];
77
83typedef struct {
84 Mix_Chunk *chunk;
85 char chunkName[100];
87
109
115void init_memory_cache();
116
122void free_shaders();
123
133ModelData * get_model_from_cache(const char *name);
134
143void add_model_to_cache(const char *name, ModelData *model);
144
150void free_models();
151
160Mix_Music * get_mix_music_from_cache(const char *name);
161
170void add_mix_music_to_cache(const char *name, Mix_Music *music);
171
177void free_musics();
178
187Mix_Chunk * get_mix_chunk_from_cache(const char *name);
188
197void add_mix_chunk_to_cache(const char *name, Mix_Chunk *chunk);
198
204void free_chunks();
205
211void free_textures();
212
218void free_cubemaps();
219
225void free_memory_cache();
226
// end of MemoryCache group
228#endif
#define u32
Alias for uint32_t (unsigned 32-bit integer).
Definition aliases.h:19
Mix_Music * get_mix_music_from_cache(const char *name)
Gets a music from the cache.
Definition memory.c:59
void add_mix_music_to_cache(const char *name, Mix_Music *music)
Adds a music to the cache.
Definition memory.c:71
void free_musics()
Frees the allocated music.
Definition memory.c:81
Mix_Chunk * get_mix_chunk_from_cache(const char *name)
Gets a sound effect from the cache.
Definition memory.c:95
void free_memory_cache()
Frees the entire memory cache.
Definition memory.c:155
void add_model_to_cache(const char *name, ModelData *model)
Adds a model to the cache.
Definition memory.c:30
void free_textures()
Frees the allocated textures.
Definition memory.c:135
ModelData * get_model_from_cache(const char *name)
Gets a model from the cache.
Definition memory.c:18
void free_shaders()
Frees the allocated shaders.
Definition memory.c:129
void free_chunks()
Frees the allocated sound effects.
Definition memory.c:117
void free_cubemaps()
Frees the allocated cubemaps.
Definition memory.c:145
u32 TextureMap
Alias for u32 representing a texture map.
Definition memory.h:25
void add_mix_chunk_to_cache(const char *name, Mix_Chunk *chunk)
Adds a sound effect to the cache.
Definition memory.c:107
void free_models()
Frees the allocated models.
Definition memory.c:40
unsigned int Shader
Represents an unsigned integer used as a shader identifier.
Definition memory.h:26
void init_memory_cache()
Initializes the memory cache.
Definition memory.c:7
Structure to cache cube map textures.
Definition memory.h:33
TextureMap cubeMap
Definition memory.h:34
Structure to manage all types of caches.
Definition memory.h:94
int musicCount
Definition memory.h:104
int chunkCount
Definition memory.h:106
int shadersCount
Definition memory.h:102
int texturesCount
Definition memory.h:98
MixChunkCache * chunkCache
Definition memory.h:105
ModelCache * modelCache
Definition memory.h:99
int modelsCount
Definition memory.h:100
int cubeMapCount
Definition memory.h:96
MixMusicCache * musicCache
Definition memory.h:103
TextureCache * textureCache
Definition memory.h:97
ShaderCache * shaderCache
Definition memory.h:101
CubeMapCache * cubeMapCache
Definition memory.h:95
Structure to cache sound effects.
Definition memory.h:83
Mix_Chunk * chunk
Definition memory.h:84
Structure to cache music.
Definition memory.h:73
Mix_Music * music
Definition memory.h:74
Structure to cache models.
Definition memory.h:53
ModelData * model
Definition memory.h:54
Structure representing the data of a 3D model.
Definition model.h:178
Structure to cache shaders.
Definition memory.h:63
Shader shader
Definition memory.h:64
Structure to cache textures.
Definition memory.h:43
TextureMap textureMap
Definition memory.h:44