NAP
imguiservice.h
1 #pragma once
2 
3 // External includes
4 #include <nap/service.h>
5 #include <utility/dllexport.h>
6 #include <renderwindow.h>
7 #include <inputevent.h>
8 
9 namespace nap
10 {
11  // Forward Declares
12  class RenderService;
13  class GuiWindow;
14 
24  class NAPAPI IMGuiService : public Service
25  {
26  RTTI_ENABLE(Service)
27  friend class GuiWindow;
28  public:
32  IMGuiService(ServiceConfiguration* configuration);
33 
38  void draw();
39 
46  void selectWindow(nap::ResourcePtr<RenderWindow> window);
47 
52  void processInputEvent(InputEvent& event);
53 
57  bool isCapturingKeyboard();
58 
62  bool isCapturingMouse();
63 
64  protected:
71  virtual bool init(utility::ErrorState& error) override;
72 
77  virtual void getDependentServices(std::vector<rtti::TypeInfo>& dependencies) override;
78 
83  virtual void update(double deltaTime) override;
84 
88  virtual void shutdown() override;
89 
90  private:
91  RenderService* mRenderer = nullptr;
92  ResourcePtr<RenderWindow> mUserWindow = nullptr;
93  bool mWindowChanged = true;
94  };
95 }
Definition: inputevent.h:19
Definition: service.h:45
Definition: core.h:24
Definition: datetime.h:373
Definition: service.h:22
Definition: imguiservice.h:24
Definition: renderwindow.h:19
Definition: renderservice.h:51
Definition: objectptr.h:175