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 ScaleMode {
41 Nearest = SDL_SCALEMODE_NEAREST,
42 Linear = SDL_SCALEMODE_LINEAR,
43};
44
46enum class Falloff {
48 Linear,
49
51 Smooth,
52
55};
56
58enum class TextJustify {
59 Left,
60 Center,
61 Right,
62};
63
65enum class FontStyle {
68 Smooth,
69
72 Pixel,
73};
74
76using Texture = std::shared_ptr<SDL_Texture>;
77
79using Font = std::shared_ptr<TTF_Font>;
80
82using Sample = std::shared_ptr<MIX_Audio>;
83
85using Music = std::shared_ptr<MIX_Audio>;
86
88using Renderer = SDL_Renderer;
89
91using Window = SDL_Window;
92
93} // namespace asw
94
95#endif // ASW_TYPES_H
Definition camera.cpp:16
std::shared_ptr< TTF_Font > Font
Alias for a shared pointer to an TTF_Font.
Definition types.h:79
std::shared_ptr< MIX_Audio > Sample
Alias for a shared pointer to an MIX_Audio.
Definition types.h:82
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
Definition types.h:76
std::shared_ptr< MIX_Audio > Music
Alias for a shared pointer to an MIX_Audio.
Definition types.h:85
BlendMode
Mappings from SDL_BLENDMODE to ASW BlendMode.
Definition types.h:26
ScaleMode
Mappings from SDL_SCALEMODE to ASW ScaleMode.
Definition types.h:40
Falloff
How a gradient or light fades from its centre to its edge.
Definition types.h:46
@ Quadratic
Bright core that drops off quickly, closer to a real light.
@ Smooth
Soft at the centre and at the edge.
SDL_Window Window
Alias for a shared pointer to an SDL_Window.
Definition types.h:91
FontStyle
How a font's glyphs are rendered.
Definition types.h:65
TextJustify
Text justification options for text rendering.
Definition types.h:58
SDL_Renderer Renderer
Alias for a shared pointer to an SDL_Renderer.
Definition types.h:88