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
asw::ColorSDL_ColorAlias for an RGBA color

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

BlendMode Enum

cpp
enum class BlendMode {
  NONE,
  BLEND,
  BLEND_PREMULTIPLIED,
  ADD,
  ADD_PREMULTIPLIED,
  MODULATE,
  MULTIPLY,
};
ValueDescription
NONENo blending
BLENDAlpha blending
BLEND_PREMULTIPLIEDPre-multiplied alpha blending
ADDAdditive blending
ADD_PREMULTIPLIEDPre-multiplied additive blending
MODULATEColor modulation
MULTIPLYMultiply blending

Example

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

Released under the MIT License.