thennequin / ImWindow

Window and GUI system based on Dear ImGui from OCornut
MIT License
828 stars 119 forks source link

Is LAYOUT_SERIALIZATION fully supported? #40

Open holyodin776 opened 2 years ago

holyodin776 commented 2 years ago

It seems that functions like "SaveLayoutToFile" and "LoadLayoutFromFile" are implemented but never used in any sample? and other related interfaces like "CreateWindowByClassName" or "GetWindowClassName" are simply return null

thennequin commented 2 years ago

The layout system works (except for special windows, but coming soon) and you need a custom RTTI system to support dynamic class creation.

The functions CreateWindowByClassName and GetWindowClassName are not implemented in ImWindow, because standard C++ RTTI is not enough for a generic serialisation system, so you need to implement your own RTTI system.

In our case the function GetWindowClassName need to return the class name, we can use typeid(*pWindow).name(), but in CreateWindowByClassName you can't dynamically create class instance via the type name.

I will commit soon (week(s) ?) a sample with a simple RTTI system to allow the Layout serialisation.

holyodin776 commented 2 years ago

that would be a greate help, thank you