4#include <SDL3_image/SDL_image.h>
11 SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Error", message.c_str(),
nullptr);
18 SDL_GetTextureSize(tex.get(), &size.
x, &size.
y);
24 TTF_Text* ttf_text = TTF_CreateText(
nullptr, font.get(), text.c_str(), 0);
26 TTF_GetTextSize(ttf_text, &size.
x, &size.
y);
27 TTF_DestroyText(ttf_text);
T y
The y component of the vector.
T x
The x component of the vector.
Structured logging system.
void error(const std::string &message)
Log an error message.
asw::Vec2< float > get_texture_size(const asw::Texture &tex)
Get texture size.
asw::Vec2< int > get_text_size(const asw::Font &font, const std::string &text)
Get text size.
void abort_on_error(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.
General utility functions.