mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:40:05 +00:00 
			
		
		
		
	Add ImGui Manager to manage creation and deletion of contexts
This commit is contained in:
		
							parent
							
								
									fef3c597d0
								
							
						
					
					
						commit
						ee2ec329da
					
				
					 5 changed files with 197 additions and 3 deletions
				
			
		
							
								
								
									
										55
									
								
								scwx-qt/source/scwx/qt/manager/imgui_manager.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								scwx-qt/source/scwx/qt/manager/imgui_manager.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,55 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <memory> | ||||
| #include <string> | ||||
| 
 | ||||
| #include <QObject> | ||||
| 
 | ||||
| struct ImGuiContext; | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace manager | ||||
| { | ||||
| 
 | ||||
| class ImGuiManagerImpl; | ||||
| 
 | ||||
| struct ImGuiContextInfo | ||||
| { | ||||
|    size_t        id_ {}; | ||||
|    std::string   name_ {}; | ||||
|    ImGuiContext* context_ {}; | ||||
| 
 | ||||
|    bool operator==(const ImGuiContextInfo& o) const; | ||||
| }; | ||||
| 
 | ||||
| class ImGuiManager : public QObject | ||||
| { | ||||
| private: | ||||
|    Q_OBJECT | ||||
|    Q_DISABLE_COPY(ImGuiManager) | ||||
| 
 | ||||
| public: | ||||
|    explicit ImGuiManager(); | ||||
|    ~ImGuiManager(); | ||||
| 
 | ||||
|    ImGuiContext* CreateContext(const std::string& name); | ||||
|    void          DestroyContext(const std::string& name); | ||||
| 
 | ||||
|    std::vector<ImGuiContextInfo> contexts() const; | ||||
| 
 | ||||
|    static ImGuiManager& Instance(); | ||||
| 
 | ||||
| signals: | ||||
|    void ContextsUpdated(); | ||||
| 
 | ||||
| private: | ||||
|    friend class ImGuiManagerImpl; | ||||
|    std::unique_ptr<ImGuiManagerImpl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace manager
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat