CWindowManager.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionMath.h>
5 #include <ionGraphics.h>
6 
7 #include "CWindow.h"
8 
9 
10 namespace ion
11 {
12 
13  enum class EWindowType
14  {
15  Fullscreen,
16  Windowed
17  };
18 
19  class CWindowManager : public Singleton<CWindowManager>, public IEventListener
20  {
21 
22  public:
23 
24  void Init(CGraphicsAPI * GraphicsAPI);
25  void PollEvents();
26  bool ShouldClose() const;
27  bool Run();
28 
29 #undef CreateWindow
30  CWindow * CreateWindow(vec2i const & Size, std::string const & Title, EWindowType const Type);
31  CWindow * CreateWindowOnMonitor(int const Monitor, std::string const & Title);
32 
33  protected:
34 
35  CGraphicsAPI * GraphicsAPI = nullptr;
36 
37  CWindow * PrimaryWindow = nullptr;
38  std::map<GLFWwindow *, CWindow *> Windows;
39 
40  static void KeyCallback(GLFWwindow * window, int key, int scancode, int action, int mods);
41  static void MouseButtonCallback(GLFWwindow * window, int button, int action, int mods);
42  static void MouseScrollCallback(GLFWwindow * window, double xoffset, double yoffset);
43  static void MouseCursorCallback(GLFWwindow * window, double xpos, double ypos);
44  static void CharCallback(GLFWwindow * window, unsigned int c);
45 
46  private:
47 
48  friend class Singleton<CWindowManager>;
50 
51  };
52 
53 }
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
Definition: CWindow.h:17
Definition: IEventListener.h:8
std::map< GLFWwindow *, CWindow * > Windows
Definition: CWindowManager.h:38
Lightweight wrapper for std::type_info that enables sorting (e.g. for use in a std::map) ...
Definition: ionClass.h:180
Base class for Singleton design pattern implementation.
Definition: ionClass.h:90
Definition: CWindowManager.h:19
Definition: CGraphicsAPI.h:54
EWindowType
Definition: CWindowManager.h:13