4#include <SDL3_image/SDL_image.h> 
    5#include <SDL3_ttf/SDL_ttf.h> 
   54  SDL_FlipMode flip = SDL_FLIP_NONE;
 
   57    flip = 
static_cast<SDL_FlipMode
>(flip | SDL_FLIP_HORIZONTAL);
 
   61    flip = 
static_cast<SDL_FlipMode
>(flip | SDL_FLIP_VERTICAL);
 
 
   73  dest.w = position.
size.x;
 
   74  dest.h = position.
size.y;
 
 
   95                           angle, 
nullptr, SDL_FLIP_NONE);
 
 
  108  r_src.w = source.
size.x;
 
  109  r_src.h = source.
size.y;
 
  114  r_dest.w = dest.
size.x;
 
  115  r_dest.h = dest.
size.y;
 
 
  131  r_src.w = source.
size.x;
 
  132  r_src.h = source.
size.y;
 
  137  r_dest.w = dest.
size.x;
 
  138  r_dest.h = dest.
size.y;
 
  141                           angle, 
nullptr, SDL_FLIP_NONE);
 
 
  145                     const std::string& text,
 
  152  const SDL_Color sdlColor =
 
  154  SDL_Surface* textSurface =
 
  155      TTF_RenderText_Solid(font.get(), 
text.c_str(), 0, sdlColor);
 
  156  SDL_Texture* textTexture =
 
  159  SDL_SetTextureBlendMode(textTexture, SDL_BLENDMODE_BLEND);
 
  160  SDL_SetTextureScaleMode(textTexture, SDL_SCALEMODE_NEAREST);
 
  165  dest.w = float(textSurface->w);
 
  166  dest.h = float(textSurface->h);
 
  169  SDL_DestroySurface(textSurface);
 
  170  SDL_DestroyTexture(textTexture);
 
 
  174                           const std::string& text,
 
 
  187                          const std::string& text,
 
 
  262  for (
int i = 0; i < 360; i++) {
 
  264                    position.
x + 
static_cast<float>(radius * std::cos(i)),
 
  265                    position.
y + 
static_cast<float>(radius * std::sin(i)));
 
 
  278  for (
int i = 0; i < 360; i++) {
 
  280                   position.
x + 
static_cast<float>(radius * std::cos(i)),
 
  281                   position.
y + 
static_cast<float>(radius * std::sin(i)));
 
 
  286  SDL_SetTextureBlendMode(texture.get(), 
static_cast<SDL_BlendMode
>(mode));
 
 
  290  SDL_SetTextureAlphaModFloat(texture.get(), alpha);
 
 
Vec2< T > size
The size of the rectangle.
 
Vec2< T > position
The position of the rectangle.
 
T y
The y component of the vector.
 
T x
The x component of the vector.
 
Display and window routines for the ASW library.
 
Routines for drawing sprites and primitives to the screen.
 
asw::Renderer * renderer
The renderer for the display module.
 
void setBlendMode(const asw::Texture &texture, asw::BlendMode mode)
Set the blend mode of a texture.
 
void sprite(const asw::Texture &tex, const asw::Vec2< float > &position)
Draw a sprite.
 
void stretchSprite(const asw::Texture &tex, const asw::Quad< float > &position)
Draw a sprite with the option to stretch it.
 
void rotateSprite(const asw::Texture &tex, const asw::Vec2< float > &position, double angle)
Draw a sprite with the option to rotate it.
 
void stretchSpriteRotateBlit(const asw::Texture &tex, const asw::Quad< float > &source, const asw::Quad< float > &dest, double angle)
Draw a sprite with the option to stretch and rotate a portion of it.
 
void textCenter(const asw::Font &font, const std::string &text, const asw::Vec2< float > &position, asw::Color color)
Draw text center aligned.
 
void line(const asw::Vec2< float > &position1, const asw::Vec2< float > &position2, asw::Color color)
Draw a line.
 
void rectFill(const asw::Quad< float > &position, asw::Color color)
Draw a filled rectangle.
 
void stretchSpriteBlit(const asw::Texture &tex, const asw::Quad< float > &source, const asw::Quad< float > &dest)
Draw a sprite with the option to stretch a portion of it.
 
void setAlpha(const asw::Texture &texture, float alpha)
Set the alpha of a texture.
 
void rect(const asw::Quad< float > &position, asw::Color color)
Draw a rectangle.
 
void circle(const asw::Vec2< float > &position, float radius, asw::Color color)
Draw a circle.
 
void spriteFlip(const asw::Texture &tex, const asw::Vec2< float > &position, bool flipX, bool flipY)
Draw a sprite with the option to flip it.
 
void circleFill(const asw::Vec2< float > &position, float radius, asw::Color color)
Draw a filled circle.
 
void point(const asw::Vec2< float > &position, asw::Color color)
Draw a point.
 
void textRight(const asw::Font &font, const std::string &text, const asw::Vec2< float > &position, asw::Color color)
Draw text right aligned.
 
void clearColor(asw::Color color)
Clear the screen to a color.
 
void text(const asw::Font &font, const std::string &text, const asw::Vec2< float > &position, asw::Color color)
Draw text left aligned.
 
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.
 
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.
 
BlendMode
Mappings from SDL_BLENDMODE to ASW BlendMode.
 
SDL_Color Color
Alias for an SDL_Color.
 
General utility functions.