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 "./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::abortOnError (const std::string &message)
 Abort program and display error message.
 
asw::Color asw::util::makeColor (int r, int g, int b)
 Make a color from RGB values.
 
asw::Color asw::util::makeColor (int r, int g, int b, int a)
 Make a color from RGBA values.
 
asw::Vec2< float > asw::util::getTextureSize (const asw::Texture &tex)
 Get texture size.
 
asw::Vec2< int > asw::util::getTextSize (const asw::Font &font, const std::string &text)
 Get text size.
 
template<typename 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.