R-Type
R-Type project
GraphicalLibManager.hpp
1 /*
2 ** EPITECH PROJECT, 2022
3 ** gameEngine2
4 ** File description:
5 ** GraphicalLibManager
6 */
7 
8 #ifndef GRAPHICALLIBMANAGER_HPP_
9 #define GRAPHICALLIBMANAGER_HPP_
10 
11 #include "Engine.hpp"
12 #include "GraphicalLib.hpp"
13 #include <thread>
14 
15 namespace KapEngine {
16  namespace Graphical {
17  class GraphicalLib;
18  class LegacyGraphicalLib;
19  }
20 }
21 
22 namespace KapEngine {
23 
29  namespace Graphical {
30 
32  public:
35 
36  void addLib(std::shared_ptr<GraphicalLib> lib);
37 
38  void removeLib(std::size_t const& index);
39  void removeLib(std::string const& name);
40 
41  bool isLibExists(std::size_t const& index);
42  bool isLibExists(std::string const& name);
43 
44  std::size_t getLibIndexFromName(std::string const& name);
45  std::string getLibNameFromIndex(std::size_t const& index);
46  std::shared_ptr<GraphicalLib> getLib(std::size_t index);
47 
48  void __update();
49 
50  std::size_t getCurrLib() const {
51  PROFILER_FUNC_START();
52  PROFILER_FUNC_END();
53  return currLib;
54  }
55 
56  std::shared_ptr<GraphicalLib> getCurrentLib() const;
57 
58  KEngine &getEngine() const {
59  return _engine;
60  }
61 
62  void changeLib(std::size_t const& libId);
63  void changeLib(std::string const& libName);
64 
65  protected:
66  private:
67  std::size_t currLib = 0;
68  std::size_t _maxLib = 0;
69 
70  std::vector<std::shared_ptr<GraphicalLib>> _libs;
71  KEngine &_engine;
72  };
73 
74  }
75 }
76 
77 #endif /* !GRAPHICALLIBMANAGER_HPP_ */
KapEngine::Graphical::GraphicalLibManager
Definition: GraphicalLibManager.hpp:31
KapEngine
main namespace
Definition: Component.hpp:17
KapEngine::KEngine
Class of engine.
Definition: Engine.hpp:60