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 Cache Management

Functions and structures for managing memory caches. More...

Classes

struct  CubeMapCache
 Structure to cache cube map textures. More...
 
struct  TextureCache
 Structure to cache textures. More...
 
struct  ModelCache
 Structure to cache models. More...
 
struct  ShaderCache
 Structure to cache shaders. More...
 
struct  MixMusicCache
 Structure to cache music. More...
 
struct  MixChunkCache
 Structure to cache sound effects. More...
 
struct  MemoryCaches
 Structure to manage all types of caches. More...
 

Typedefs

typedef u32 TextureMap
 Alias for u32 representing a texture map.
 
typedef unsigned int Shader
 Represents an unsigned integer used as a shader identifier.
 

Functions

void init_memory_cache ()
 Initializes the memory cache.
 
void free_shaders ()
 Frees the allocated shaders.
 
ModelDataget_model_from_cache (const char *name)
 Gets a model from the cache.
 
void add_model_to_cache (const char *name, ModelData *model)
 Adds a model to the cache.
 
void free_models ()
 Frees the allocated models.
 
Mix_Music * get_mix_music_from_cache (const char *name)
 Gets a music from the cache.
 
void add_mix_music_to_cache (const char *name, Mix_Music *music)
 Adds a music to the cache.
 
void free_musics ()
 Frees the allocated music.
 
Mix_Chunk * get_mix_chunk_from_cache (const char *name)
 Gets a sound effect from the cache.
 
void add_mix_chunk_to_cache (const char *name, Mix_Chunk *chunk)
 Adds a sound effect to the cache.
 
void free_chunks ()
 Frees the allocated sound effects.
 
void free_textures ()
 Frees the allocated textures.
 
void free_cubemaps ()
 Frees the allocated cubemaps.
 
void free_memory_cache ()
 Frees the entire memory cache.
 

Detailed Description

Functions and structures for managing memory caches.

This module provides structures and functions to manage caches for cube maps, textures, models, and shaders. It includes initialization and cleanup functions to handle the memory allocation and deallocation for these resources.

Typedef Documentation

◆ TextureMap

Alias for u32 representing a texture map.

◆ Shader

Represents an unsigned integer used as a shader identifier.

Function Documentation

◆ init_memory_cache()

void init_memory_cache ( )

Initializes the memory cache.

This function sets up the memory cache for use in the project.

◆ free_shaders()

void free_shaders ( )

Frees the allocated shaders.

This function releases the memory allocated for shaders.

◆ get_model_from_cache()

ModelData * get_model_from_cache ( const char *  name)

Gets a model from the cache.

Parameters
nameThe name of the model.
Returns
A pointer to the model data.

This function retrieves a model from the cache with the specified name. If the model is not found, it returns NULL.

◆ add_model_to_cache()

void add_model_to_cache ( const char *  name,
ModelData model 
)

Adds a model to the cache.

Parameters
nameThe name of the model.
modelThe model data to add to the cache.

This function adds a model to the cache with the specified name.

◆ free_models()

void free_models ( )

Frees the allocated models.

This function releases the memory allocated for models.

◆ get_mix_music_from_cache()

Mix_Music * get_mix_music_from_cache ( const char *  name)

Gets a music from the cache.

Parameters
nameThe name of the music.
Returns
A pointer to the music data.

This function retrieves a music from the cache with the specified name.

◆ add_mix_music_to_cache()

void add_mix_music_to_cache ( const char *  name,
Mix_Music *  music 
)

Adds a music to the cache.

Parameters
nameThe name of the music.
musicThe music data to add to the cache.

This function adds a music to the cache with the specified name.

◆ free_musics()

void free_musics ( )

Frees the allocated music.

This function releases the memory allocated for music.

◆ get_mix_chunk_from_cache()

Mix_Chunk * get_mix_chunk_from_cache ( const char *  name)

Gets a sound effect from the cache.

Parameters
nameThe name of the sound effect.
Returns
A pointer to the sound effect data.

This function retrieves a sound effect from the cache with the specified name.

◆ add_mix_chunk_to_cache()

void add_mix_chunk_to_cache ( const char *  name,
Mix_Chunk *  chunk 
)

Adds a sound effect to the cache.

Parameters
nameThe name of the sound effect.
musicThe sound effect data to add to the cache.

This function adds a sound effect to the cache with the specified name.

◆ free_chunks()

void free_chunks ( )

Frees the allocated sound effects.

This function releases the memory allocated for sound effects.

◆ free_textures()

void free_textures ( )

Frees the allocated textures.

This function releases the memory allocated for textures.

◆ free_cubemaps()

void free_cubemaps ( )

Frees the allocated cubemaps.

This function releases the memory allocated for cubemaps.

◆ free_memory_cache()

void free_memory_cache ( )

Frees the entire memory cache.

This function releases all memory allocated in the memory cache.