R-Type 0.1
Loading...
Searching...
No Matches
menuScene.hpp
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5#include <optional>
6#include <vector>
7
8#include "graphical/renderWindow.hpp"
9#include "sceneManager/sceneConcept.hpp"
10
11#include "sceneType.hpp"
12
13namespace rtype::client {
22class MenuScene {
23public:
28 explicit MenuScene(rtk::RenderWindow &window);
29 ~MenuScene() = default;
30
32 static constexpr SceneType Type = SceneType::Menu;
33
38 void onEnter(rtk::EngineContext &context);
39
47 std::optional<SceneType> onUpdate(rtk::EngineContext &context,
48 const rtk::InputState &inputState,
49 float dt);
50
55 void onExit(rtk::EngineContext &context);
56
57private:
58 rtk::RenderWindow &_window;
59
60 std::vector<std::size_t> _entities;
61 std::uint32_t _textureId = 0;
62};
63
65} // namespace rtype::client
Title screen, which waits for the Confirm action.
Definition menuScene.hpp:22
void onEnter(rtk::EngineContext &context)
Shows the menu picture.
Definition menuScene.cpp:11
std::optional< SceneType > onUpdate(rtk::EngineContext &context, const rtk::InputState &inputState, float dt)
Goes to the connection scene when Confirm is pressed.
Definition menuScene.cpp:36
void onExit(rtk::EngineContext &context)
Destroys the menu entities.
Definition menuScene.cpp:45
MenuScene(rtk::RenderWindow &window)
Creates the scene.
Definition menuScene.cpp:9
static constexpr SceneType Type
Identifier of this scene.
Definition menuScene.hpp:32
SceneType
Identifiers of the client scenes.
Definition sceneType.hpp:12
Engine services handed to the game and its scenes.
Definition EngineContext.hpp:20
Player input sampled during the current frame.
Definition InputAction.hpp:14