Updated About the IMGUI paradigm (markdown)

omar 2023-08-25 15:57:05 +02:00
parent 107f6f16e1
commit f1aa74b704

@ -68,7 +68,7 @@ void SetDocumentDirty(bool dirty)
m_Document->m_IsDirty = dirty; m_Document->m_IsDirty = dirty;
UpdateSaveEnabledState(); UpdateSaveEnabledState();
} }
set SetDocument(Document* document) void SetDocument(Document* document)
{ {
m_Document = document; m_Document = document;
UpdateSaveEnabledState(); UpdateSaveEnabledState();
@ -78,9 +78,12 @@ set SetDocument(Document* document)
Typical IMGUI: Typical IMGUI:
```cpp ```cpp
// editor.cpp // editor.cpp
bool is_save_allowed = (m_Document != NULL && m_Document->m_IsDirty); void UpdateUI()
if (Lib_MenuItem("SAVE", is_save_allowed)) {
bool is_save_allowed = (m_Document != NULL && m_Document->m_IsDirty);
if (Lib_MenuItem("SAVE", is_save_allowed))
m_Document->Save(); m_Document->Save();
}
``` ```
This is a simple and perhaps exaggerated example provided to get a better intuition about the difference of IMGUI vs RMGUI. There are lots of things to say and criticize about this example. It tends to illustrates the shortcoming of RMGUIs more than it illustrates the shortcomings of IMGUIs. But it should illustrate the core benefit that IMGUIs **tends to facilitate data binding, action binding, and creation/destruction of UI components**. It does facilitate those things because it generally doesn't need them. This is a simple and perhaps exaggerated example provided to get a better intuition about the difference of IMGUI vs RMGUI. There are lots of things to say and criticize about this example. It tends to illustrates the shortcoming of RMGUIs more than it illustrates the shortcomings of IMGUIs. But it should illustrate the core benefit that IMGUIs **tends to facilitate data binding, action binding, and creation/destruction of UI components**. It does facilitate those things because it generally doesn't need them.