Implementation:Google deepmind Mujoco Platform ImGui Widgets
| Knowledge Sources | |
|---|---|
| Domains | GUI, Utility |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
Defines reusable ImGui widget utilities, FontAwesome icon constants, and INI file serialization helpers for the MuJoCo platform GUI layer.
Description
imgui_widgets.h is a header providing shared GUI infrastructure for MuJoCo platform applications. It defines FontAwesome icon byte sequences (play, pause, camera, refresh, undo, etc.) as static constexpr strings for use in ImGui buttons and labels. The file also provides INI file read/write utilities (AppendIniSection, ReadIniSection, ReadIniValue) for persisting user settings, and a type-safe ReadIniValue template that handles int, float, double, string, and enum deserialization. A dependent_false template workaround addresses compilation issues on older GCC and Clang versions.
Usage
Included by gui.cc, app.cc, and other platform GUI files to access shared icon constants and settings persistence utilities. The INI functions are used to save and restore user preferences such as window layout, theme selection, and simulation parameters.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: src/experimental/platform/imgui_widgets.h
- Lines: 1-302
Key Functions
void AppendIniSection(std::string& ini, const std::string& section, const KeyValues& key_values);
KeyValues ReadIniSection(const std::string& contents, const std::string& section);
template <typename T> T ReadIniValue(const KeyValues& key_values, const std::string& key, T def);
// FontAwesome icon constants: ICON_FA_PLAY, ICON_FA_PAUSE, ICON_FA_CAMERA, etc.
Import
#include "experimental/platform/imgui_widgets.h"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| ini contents | std::string | Yes | Raw INI file text for reading sections |
| section | std::string | Yes | INI section name to read or write |
| key_values | KeyValues (unordered_map) | Yes | Key-value pairs for INI section writing |
Outputs
| Name | Type | Description |
|---|---|---|
| KeyValues | std::unordered_map<std::string, std::string> | Parsed key-value pairs from an INI section |
| T | Template type | Deserialized value from INI (int, float, double, string, or enum) |