4#include <SDL3_image/SDL_image.h>
7 SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Error", message.c_str(),
32 SDL_GetTextureSize(tex.get(), &size.
x, &size.
y);
37 const std::string& text) {
38 TTF_Text* ttf_text = TTF_CreateText(
nullptr, font.get(), text.c_str(), 0);
40 TTF_GetTextSize(ttf_text, &size.
x, &size.
y);
T y
The y component of the vector.
T x
The x component of the vector.
asw::Vec2< float > getTextureSize(const asw::Texture &tex)
Get texture size.
asw::Color makeColor(int r, int g, int b)
Make a color from RGB values.
asw::Vec2< int > getTextSize(const asw::Font &font, const std::string &text)
Get text size.
void abortOnError(const std::string &message)
Abort program and display error message.
std::shared_ptr< TTF_Font > Font
Alias for a shared pointer to an TTF_Font.
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
SDL_Color Color
Alias for an SDL_Color.
General utility functions.