Euphoria
root.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "base/vec2.h"
4 
5 #include "gui/uistate.h"
6 #include "gui/layoutcontainer.h"
7 
8 
9 
10 #include <memory>
11 
12 
13 namespace eu::io
14 {
15  struct FileSystem;
16  struct FilePath;
17 }
18 
19 namespace eu::render
20 {
21  struct Texture2;
22  struct FontCache;
23  struct TextureCache;
24 }
25 
26 namespace eu::gui
27 {
28  struct Skin;
29 }
30 
31 
32 namespace eu::gui
33 {
34 
35  struct Root
36  {
37  explicit Root(const size2f& s);
38  ~Root();
39 
40  Root(const Root& other) = delete;
41  void operator=(const Root&) = delete;
42  Root(Root&& other) = delete;
43  void operator=(Root&&) = delete;
44 
45  [[nodiscard]] bool
46  load
47  (
48  io::FileSystem* fs,
49  render::FontCache* font,
50  const ::eu::io::FilePath& path,
52  );
53 
54  void
55  set_input_mouse(const vec2f& pos, bool down);
56 
57  void
58  update(float dt);
59 
60  void
61  set_size(const size2f& new_size);
62 
63  void
64  render(render::SpriteRenderer* sp) const;
65 
66  std::vector<std::shared_ptr<Skin>> skins;
70  std::shared_ptr<render::Texture2> cursor_image;
71  std::shared_ptr<render::Texture2> hover_image;
72  };
73 }
74 
Definition: enum.h:8
Root(const Root &other)=delete
std::shared_ptr< render::Texture2 > hover_image
Definition: root.h:71
void set_size(const size2f &new_size)
Definition: root.cc:60
State state
Definition: root.h:68
std::vector< std::shared_ptr< Skin > > skins
Definition: root.h:66
size2f size
Definition: root.h:67
void set_input_mouse(const vec2f &pos, bool down)
Definition: root.cc:43
void operator=(const Root &)=delete
void update(float dt)
Definition: root.cc:51
LayoutContainer container
Definition: root.h:69
void render(render::SpriteRenderer *sp) const
Definition: root.cc:68
void operator=(Root &&)=delete
std::shared_ptr< render::Texture2 > cursor_image
Definition: root.h:70
bool load(io::FileSystem *fs, render::FontCache *font, const ::eu::io::FilePath &path, render::TextureCache *cache)
Definition: root.cc:24
Root(Root &&other)=delete
Root(const size2f &s)
Definition: root.cc:13
Definition: vec2.h:33