vkmEngine 1.0.0
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
40 void add(const std::string& path, float hold);
41
47 void setFade(float seconds) { m_fade = seconds; }
48
49 private:
50 struct Entry {
51 std::string path;
52 float hold = 0.0f;
53 };
54
55 private:
56 std::vector<Entry> m_entries;
57 size_t m_current = 0;
58 float m_elapsed = 0.0f;
59 float m_fade = 0.5f;
60 SplashFrame m_frame;
61};
62
63} // namespace Vkm::Engine
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:47
void add(const std::string &path, float hold)
Append path to the sequence.
Per-frame state bundle passed to every system.
Definition system.h:55