27std::string
get_path(
const std::string& filename);
37std::string
get_save_path(
const std::string& org,
const std::string& app);
50std::string
read_save(
const std::string& org,
const std::string& app,
const std::string& name);
60bool write_save(
const std::string& org,
const std::string& app,
const std::string& name,
61 const std::string& data);
asw::Sample get_sample(const std::string &key)
Get a cached sample.
std::string read_save(const std::string &org, const std::string &app, const std::string &name)
Read save data written by write_save, e.g. progress or settings.
bool write_save(const std::string &org, const std::string &app, const std::string &name, const std::string &data)
Write save data, replacing what was saved under the name before.
asw::Texture create_texture(int w, int h)
Create a Texture given the specified dimensions.
void unload_music(const std::string &key)
Remove a cached music.
std::string get_path(const std::string &filename)
Get the full path to an asset given its filename. The filename is relative to the base path of the ap...
asw::Texture get_texture(const std::string &key)
Get a cached texture.
void unload_sample(const std::string &key)
Remove a cached sample.
asw::Texture create_radial_gradient(int size, asw::Color inner, asw::Color outer, asw::Falloff falloff=asw::Falloff::Smooth)
Create a square texture with a radial gradient. The colour goes from inner at the centre to outer at ...
std::string get_save_path(const std::string &org, const std::string &app)
Get a writable folder for save files and settings, unique to the organisation and application....
void unload_font(const std::string &key)
Remove a cached font.
asw::Music load_music(const std::string &filename)
Loads a music file from a file. Formats supported are WAV, AIFF, RIFF, OGG and VOC....
asw::Font load_font(const std::string &filename, float size, asw::FontStyle style=asw::FontStyle::Smooth)
Loads a TTF font from a file. This will abort if the file is not found.
void clear_all()
Clear all cached assets. This will remove all cached textures, fonts, samples, and music.
void unload_texture(const std::string &key)
Remove a cached texture.
asw::Music get_music(const std::string &key)
Get a cached music.
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 th...
asw::Font get_font(const std::string &key)
Get a cached font.
asw::Texture load_texture(const std::string &filename)
Loads a texture from a file. Formats supported are PNG, ICO, CUR, BMP, GIF, JPG, LBM,...
std::shared_ptr< TTF_Font > Font
Alias for a shared pointer to an TTF_Font.
std::shared_ptr< MIX_Audio > Sample
Alias for a shared pointer to an MIX_Audio.
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
std::shared_ptr< MIX_Audio > Music
Alias for a shared pointer to an MIX_Audio.
Falloff
How a gradient or light fades from its centre to its edge.
@ Smooth
Soft at the centre and at the edge.
FontStyle
How a font's glyphs are rendered.
RGBA color struct with 8-bit channels.
Types used throughout the ASW library.
General utility functions.