4#include <SDL3_image/SDL_image.h>
10 SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Error", message.c_str(),
17 SDL_GetTextureSize(tex.get(), &size.
x, &size.
y);
22 const std::string& text) {
23 TTF_Text* ttf_text = TTF_CreateText(
nullptr, font.get(), text.c_str(), 0);
25 TTF_GetTextSize(ttf_text, &size.
x, &size.
y);
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 > getTextureSize(const asw::Texture &tex)
Get texture size.
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.
General utility functions.