ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1
8
9#ifndef ASW_TYPES_H
10#define ASW_TYPES_H
11
12#include <SDL3/SDL.h>
13#include <SDL3_mixer/SDL_mixer.h>
14#include <SDL3_ttf/SDL_ttf.h>
15#include <memory>
16#include <type_traits>
17
18namespace asw {
19
26enum class BlendMode : SDL_BlendMode {
27 None = SDL_BLENDMODE_NONE,
28 Blend = SDL_BLENDMODE_BLEND,
29 BlendPremultiplied = SDL_BLENDMODE_BLEND_PREMULTIPLIED,
30 Add = SDL_BLENDMODE_ADD,
31 AddPremultiplied = SDL_BLENDMODE_ADD_PREMULTIPLIED,
32 Modulate = SDL_BLENDMODE_MOD,
33 Multiply = SDL_BLENDMODE_MUL,
34};
35
36static_assert(std::is_same_v<std::underlying_type_t<BlendMode>, SDL_BlendMode>,
37 "BlendMode must share SDL_BlendMode's underlying type");
38
40enum class TextJustify {
41 Left,
42 Center,
43 Right,
44};
45
47using Texture = std::shared_ptr<SDL_Texture>;
48
50using Font = std::shared_ptr<TTF_Font>;
51
53using Sample = std::shared_ptr<MIX_Audio>;
54
56using Music = std::shared_ptr<MIX_Audio>;
57
59using Renderer = SDL_Renderer;
60
62using Window = SDL_Window;
63
64} // namespace asw
65
66#endif // ASW_TYPES_H
std::shared_ptr< TTF_Font > Font
Alias for a shared pointer to an TTF_Font.
Definition types.h:50
std::shared_ptr< MIX_Audio > Sample
Alias for a shared pointer to an MIX_Audio.
Definition types.h:53
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
Definition types.h:47
std::shared_ptr< MIX_Audio > Music
Alias for a shared pointer to an MIX_Audio.
Definition types.h:56
BlendMode
Mappings from SDL_BLENDMODE to ASW BlendMode.
Definition types.h:26
SDL_Window Window
Alias for a shared pointer to an SDL_Window.
Definition types.h:62
TextJustify
Text justification options for text rendering.
Definition types.h:40
SDL_Renderer Renderer
Alias for a shared pointer to an SDL_Renderer.
Definition types.h:59