vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
splash_system.h
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include "core/system.h"
7#include "system/splash/splash_frame.h"
8
9namespace Vkm::Engine {
10
18class SplashSystem : public System {
19 public:
20 SplashSystem() = default;
21 ~SplashSystem() override = default;
22
23 SplashSystem(const SplashSystem& other) = delete;
24 SplashSystem& operator=(const SplashSystem& other) = delete;
25
26 SplashSystem(SplashSystem && other) = delete;
27 SplashSystem& operator=(SplashSystem && other) = delete;
28
29 public:
30 void update(FrameContext& ctx) override;
31
42 void add(const std::string& path, float hold, const std::string& caption = {});
43
49 void setFade(float seconds) { m_fade = seconds; }
50
51 private:
52 struct Entry {
53 std::string path;
54 float hold = 0.0f;
55 std::string caption;
56 };
57
58 private:
59 std::vector<Entry> m_entries;
60 size_t m_current = 0;
61 float m_elapsed = 0.0f;
62 float m_fade = 0.5f;
63 SplashFrame m_frame;
64};
65
66} // namespace Vkm::Engine
void add(const std::string &path, float hold, const std::string &caption={})
Append path to the sequence.
void update(FrameContext &ctx) override
Execute this system for the current frame.
void setFade(float seconds)
Set the fade at each end of every entry.
Definition splash_system.h:49
Per-frame state bundle passed to every system.
Definition system.h:57