Skip to content

Types

Core type aliases used throughout the ASW library.

Header: #include <asw/modules/types.h>Namespace: asw

Type Aliases

TypeUnderlyingDescription
asw::Texturestd::shared_ptr<SDL_Texture>A shared pointer to an SDL texture
asw::Fontstd::shared_ptr<TTF_Font>A shared pointer to a TTF font
asw::Samplestd::shared_ptr<Mix_Chunk>A shared pointer to a sound effect
asw::Musicstd::shared_ptr<Mix_Music>A shared pointer to music
asw::RendererSDL_RendererAlias for the SDL renderer
asw::WindowSDL_WindowAlias for the SDL window

All asset types (Texture, Font, Sample, Music) use shared_ptr for automatic memory management.

BlendMode Enum

cpp
enum class BlendMode {
  None,
  Blend,
  BlendPremultiplied,
  Add,
  AddPremultiplied,
  Modulate,
  Multiply,
};
ValueDescription
NoneNo blending
BlendAlpha blending
BlendPremultipliedPre-multiplied alpha blending
AddAdditive blending
AddPremultipliedPre-multiplied additive blending
ModulateColor modulation
MultiplyMultiply blending

TextJustify Enum

cpp
enum class TextJustify {
  Left,
  Center,
  Right,
};

Used with asw::draw::text() and asw::game::Text to control text alignment.

Example

cpp
asw::Color red(255, 0, 0);
asw::Texture tex = asw::assets::load_texture("image.png");

Released under the MIT License.