Skip to content

Commit 681fe92

Browse files
committed
ImGui threading
1 parent 0461aff commit 681fe92

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pages/docs/ui/imgui.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ The [RTS Sample](../../samples/rts.md) and the [Sample Game Plugin](../../sample
6666

6767
## Limitations
6868

69+
### Threading Constraints
70+
71+
ImGui is **not thread-safe** and must only be called from the main thread. This means you cannot call ImGui functions from [component](../runtime/world/components.md) `Update()` methods, as component updates run in parallel across multiple threads.
72+
73+
Instead, call ImGui from your [game state](../runtime/application/game-state.md), which runs on the main thread. If you need to display component data in ImGui, cache the relevant values in your component and read them from the game state when building your UI.
74+
75+
### Styling
76+
6977
It is very difficult to adjust the appearance of ImGui elements. Use ImGui for developer tools and to prototype ideas quickly. Prefer to use [RmlUi](rmlui.md) once you need more control over the look and feel.
7078

7179
## See Also

0 commit comments

Comments
 (0)