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++.
Loading...
Searching...
No Matches
util.h File Reference

General utility functions. More...

#include <algorithm>
#include <string>
#include <string_view>
#include "./easing.h"
#include "./geometry.h"
#include "./types.h"
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  asw
 
namespace  asw::util
 

Functions

void asw::util::abort_on_error (const std::string &message)
 Abort program and display error message.
 
asw::Vec2< float > asw::util::get_texture_size (const asw::Texture &tex)
 Get texture size.
 
asw::Vec2< int > asw::util::get_text_size (const asw::Font &font, std::string_view text)
 Get text size.
 
int asw::util::get_font_height (const asw::Font &font)
 Get the height of a line of text in a font.
 
bool asw::util::open_url (const std::string &url)
 Open a web page in the player's browser, e.g. a login or store page. Web builds open it in a new tab.
 
void asw::util::clear_text_size_cache ()
 Clear cached text metrics.
 
template<typename T >
T asw::util::lerp (const T &a, const T &b, float t)
 Lerp between two values.
 

Detailed Description

General utility functions.

Author
Allan Legemaate (alege.nosp@m.maat.nosp@m.e@gma.nosp@m.il.c.nosp@m.om)
Date
2023-09-20

Definition in file util.h.