|
ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
|
Functions | |
| std::string | get_path (const std::string &filename) |
| Get the full path to an asset given its filename. This assumes that all assets are located in an "assets" directory relative to the base path of the application. This will abort if the base path cannot be determined. | |
| asw::Texture | load_texture (const std::string &filename) |
| Loads a texture from a file. Formats supported are PNG, ICO, CUR, BMP, GIF, JPG, LBM, PCX, PNM, TIF, XCF, XPM, XV, and WEBP. This will abort if the file is not found. | |
| asw::Texture | load_texture (const std::string &filename, const std::string &key) |
| Load a texture from a file and cache it. | |
| asw::Texture | get_texture (const std::string &key) |
| Get a cached texture. | |
| void | unload_texture (const std::string &key) |
| Remove a cached texture. | |
| asw::Texture | create_texture (int w, int h) |
| Create a Texture given the specified dimensions. | |
| asw::Font | load_font (const std::string &filename, float size) |
| Loads a TTF font from a file. This will abort if the file is not found. | |
| asw::Font | load_font (const std::string &filename, float size, const std::string &key) |
| Load a font from a file and cache it. | |
| asw::Font | get_font (const std::string &key) |
| Get a cached font. | |
| void | unload_font (const std::string &key) |
| Remove a cached font. | |
| asw::Sample | load_sample (const std::string &filename) |
| Loads a sample from a file. Formats supported are WAV, AIFF, RIFF, OGG and VOC. This will abort if the file is not found. | |
| asw::Sample | load_sample (const std::string &filename, const std::string &key) |
| Load a sample from a file and cache it. | |
| asw::Sample | get_sample (const std::string &key) |
| Get a cached sample. | |
| void | unload_sample (const std::string &key) |
| Remove a cached sample. | |
| asw::Music | load_music (const std::string &filename) |
| Loads a music file from a file. Formats supported are WAV, AIFF, RIFF, OGG and VOC. This will abort if the file is not found. | |
| asw::Music | load_music (const std::string &filename, const std::string &key) |
| Load a music file from a file and cache it. | |
| asw::Music | get_music (const std::string &key) |
| Get a cached music. | |
| void | unload_music (const std::string &key) |
| Remove a cached music. | |
| void | clear_all () |
| Clear all cached assets. This will remove all cached textures, fonts, samples, and music. | |
| void asw::assets::clear_all | ( | ) |
Clear all cached assets. This will remove all cached textures, fonts, samples, and music.
Definition at line 207 of file assets.cpp.
| asw::Texture asw::assets::create_texture | ( | int | w, |
| int | h ) |
Create a Texture given the specified dimensions.
| w | The width of the texture. |
| h | The height of the texture. |
Definition at line 76 of file assets.cpp.
| asw::Font asw::assets::get_font | ( | const std::string & | key | ) |
Get a cached font.
| key | The key of the cached font. |
Definition at line 113 of file assets.cpp.
| asw::Music asw::assets::get_music | ( | const std::string & | key | ) |
Get a cached music.
| key | The key of the cached music. |
Definition at line 191 of file assets.cpp.
| std::string asw::assets::get_path | ( | const std::string & | filename | ) |
Get the full path to an asset given its filename. This assumes that all assets are located in an "assets" directory relative to the base path of the application. This will abort if the base path cannot be determined.
| filename |
Definition at line 23 of file assets.cpp.
| asw::Sample asw::assets::get_sample | ( | const std::string & | key | ) |
Get a cached sample.
| key | The key of the cached sample. |
Definition at line 152 of file assets.cpp.
| asw::Texture asw::assets::get_texture | ( | const std::string & | key | ) |
Get a cached texture.
| key | The key of the cached texture. |
Definition at line 62 of file assets.cpp.
| asw::Font asw::assets::load_font | ( | const std::string & | filename, |
| float | size ) |
Loads a TTF font from a file. This will abort if the file is not found.
| filename | The path to the font file. |
| size | The size of the font. |
Definition at line 90 of file assets.cpp.
| asw::Font asw::assets::load_font | ( | const std::string & | filename, |
| float | size, | ||
| const std::string & | key ) |
Load a font from a file and cache it.
| filename | The path to the font file. |
| size | The size of the font. |
| key | The key to associate with the loaded font for caching. |
Definition at line 102 of file assets.cpp.
| asw::Music asw::assets::load_music | ( | const std::string & | filename | ) |
Loads a music file from a file. Formats supported are WAV, AIFF, RIFF, OGG and VOC. This will abort if the file is not found.
| filename | The path to the music file. |
Definition at line 168 of file assets.cpp.
| asw::Music asw::assets::load_music | ( | const std::string & | filename, |
| const std::string & | key ) |
Load a music file from a file and cache it.
| filename | The path to the music file. |
| key | The key to associate with the loaded music for caching. |
Definition at line 180 of file assets.cpp.
| asw::Sample asw::assets::load_sample | ( | const std::string & | filename | ) |
Loads a sample from a file. Formats supported are WAV, AIFF, RIFF, OGG and VOC. This will abort if the file is not found.
| filename | The path to the sample file. |
Definition at line 129 of file assets.cpp.
| asw::Sample asw::assets::load_sample | ( | const std::string & | filename, |
| const std::string & | key ) |
Load a sample from a file and cache it.
| filename | The path to the sample file. |
| key | The key to associate with the loaded sample for caching. |
Definition at line 141 of file assets.cpp.
| asw::Texture asw::assets::load_texture | ( | const std::string & | filename | ) |
Loads a texture from a file. Formats supported are PNG, ICO, CUR, BMP, GIF, JPG, LBM, PCX, PNM, TIF, XCF, XPM, XV, and WEBP. This will abort if the file is not found.
| filename | The path to the texture file. |
Definition at line 36 of file assets.cpp.
| asw::Texture asw::assets::load_texture | ( | const std::string & | filename, |
| const std::string & | key ) |
Load a texture from a file and cache it.
| filename | The path to the texture file. |
| key | The key to associate with the loaded texture for caching. |
Definition at line 51 of file assets.cpp.
| void asw::assets::unload_font | ( | const std::string & | key | ) |
Remove a cached font.
| key | The key of the cached font to remove. |
Definition at line 122 of file assets.cpp.
| void asw::assets::unload_music | ( | const std::string & | key | ) |
Remove a cached music.
| key | The key of the cached music to remove. |
Definition at line 200 of file assets.cpp.
| void asw::assets::unload_sample | ( | const std::string & | key | ) |
Remove a cached sample.
| key | The key of the cached sample to remove. |
Definition at line 161 of file assets.cpp.
| void asw::assets::unload_texture | ( | const std::string & | key | ) |
Remove a cached texture.
| key | The key of the cached texture to remove. |
Definition at line 71 of file assets.cpp.