Wizard Engine
2D cross-platform game engine built around SDL2
 
Loading...
Searching...
No Matches
renderable.hpp
Go to the documentation of this file.
1/*
2 Wizard Engine
3 Copyright (C) 2023-2024 Zana Domán
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22#ifndef WIZARD_ENGINE_RENDERABLE_HPP
23#define WIZARD_ENGINE_RENDERABLE_HPP
24
28
29namespace wze {
36 private:
37 static std::vector<renderable*> _instances;
38 SDL_FRect _screen_area;
39 float _screen_angle;
40
41 public:
42#ifdef __WIZARD_ENGINE_INTERNAL__
49 [[nodiscard]] static std::vector<renderable*> const& instances();
50#endif /* __WIZARD_ENGINE_INTERNAL__ */
51
58 [[nodiscard]] SDL_FRect const& screen_area() const;
59
60#ifdef __WIZARD_ENGINE_INTERNAL__
67 void set_screen_area(SDL_FRect const& screen_area);
68#endif /* __WIZARD_ENGINE_INTERNAL__ */
69
76 [[nodiscard]] float screen_angle() const;
77
78#ifdef __WIZARD_ENGINE_INTERNAL__
85 void set_screen_angle(float screen_angle);
86#endif /* __WIZARD_ENGINE_INTERNAL__ */
87
94 [[nodiscard]] virtual float x() const = 0;
95
102 [[nodiscard]] virtual float y() const = 0;
103
111 [[nodiscard]] virtual float z() const = 0;
112
119 [[nodiscard]] virtual float angle() const = 0;
120
127 [[nodiscard]] virtual float width() const = 0;
128
135 [[nodiscard]] virtual float height() const = 0;
136
143 [[nodiscard]] virtual bool spatial() const = 0;
144
151 [[nodiscard]] virtual std::shared_ptr<wze::texture> const&
152 texture() const = 0;
153
160 [[nodiscard]] virtual uint8_t color_r() const = 0;
161
168 [[nodiscard]] virtual uint8_t color_g() const = 0;
169
176 [[nodiscard]] virtual uint8_t color_b() const = 0;
177
184 [[nodiscard]] virtual uint8_t color_a() const = 0;
185
192 [[nodiscard]] virtual wze::flip flip() const = 0;
193
200 [[nodiscard]] virtual bool visible() const = 0;
201
208 [[nodiscard]] virtual uint8_t priority() const = 0;
209
215 renderable();
216
223 renderable(renderable const& other);
224
230 virtual ~renderable();
231
239 renderable& operator=(renderable const& other);
240};
241} /* namespace wze */
242
243#endif /* WIZARD_ENGINE_RENDERABLE_HPP */
Image file in host memory.
Enumerations.
Export header of the Wizard Engine.
Wizard Engine.
flip
Flips.
Definition enums.hpp:37