27 lines
		
	
	
		
			731 B
		
	
	
	
		
			C++
		
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			731 B
		
	
	
	
		
			C++
		
	
	
	
#ifndef INTERFACE_H_
 | 
						|
#define INTERFACE_H_
 | 
						|
 | 
						|
#include <imgui.h>
 | 
						|
#include <string>
 | 
						|
#include <vector>
 | 
						|
#include <functional>
 | 
						|
 | 
						|
struct Window {
 | 
						|
    std::string name;
 | 
						|
    ImVec2 size;
 | 
						|
    ImVec2 position;
 | 
						|
    bool isOpen = true;
 | 
						|
 | 
						|
    std::function<void()> renderContent;
 | 
						|
 | 
						|
    Window(const std::string& name, std::function<void()> renderFunc)
 | 
						|
        : name(name), size(ImVec2(512, 512)), position(ImVec2(0, 0)), renderContent(renderFunc) {}
 | 
						|
};
 | 
						|
 | 
						|
namespace Interface {
 | 
						|
    void AddWindow(std::vector<Window>& windows, const std::string& name, std::function<void()> renderFunc);
 | 
						|
    Window* GetWindowByName(std::vector<Window>& windows, const std::string& name);
 | 
						|
    void RenderWindows(std::vector<Window>& windows);
 | 
						|
}
 | 
						|
 | 
						|
#endif // INTERFACE_H_
 |