Class: ImGuiStorage
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- ImGuiStorage
- Defined in:
- lib/imgui.rb
Overview
Helper: Key->Value storage Typically you don’t have to worry about this since a storage is held within each Window. We use it to e.g. store collapse state for a tree (Int 0/1) This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame) You can use it as custom user storage for temporary values. Declare your own storage if, for example:
-
You want to manipulate the open/close state of a particular sub-tree in your interface (tree node uses Int 0/1 to store their state).
-
You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient)
Types are NOT stored, so it is up to you to make sure your Key don’t collide with different types.
Instance Method Summary collapse
- #BuildSortByKey ⇒ Object
- #Clear ⇒ Object
- #GetBool(key, default_val = false) ⇒ Object
- #GetBoolRef(key, default_val = false) ⇒ Object
- #GetFloat(key, default_val = 0.0) ⇒ Object
- #GetFloatRef(key, default_val = 0.0) ⇒ Object
- #GetInt(key, default_val = 0) ⇒ Object
- #GetIntRef(key, default_val = 0) ⇒ Object
- #GetVoidPtr(key) ⇒ Object
- #GetVoidPtrRef(key, default_val = nil) ⇒ Object
- #SetAllInt(val) ⇒ Object
- #SetBool(key, val) ⇒ Object
- #SetFloat(key, val) ⇒ Object
- #SetInt(key, val) ⇒ Object
- #SetVoidPtr(key, val) ⇒ Object
Instance Method Details
#BuildSortByKey ⇒ Object
1638 1639 1640 |
# File 'lib/imgui.rb', line 1638 def BuildSortByKey() ImGui::ImGuiStorage_BuildSortByKey(self) end |
#Clear ⇒ Object
1642 1643 1644 |
# File 'lib/imgui.rb', line 1642 def Clear() ImGui::ImGuiStorage_Clear(self) end |
#GetBool(key, default_val = false) ⇒ Object
1646 1647 1648 |
# File 'lib/imgui.rb', line 1646 def GetBool(key, default_val = false) ImGui::ImGuiStorage_GetBool(self, key, default_val) end |
#GetBoolRef(key, default_val = false) ⇒ Object
1650 1651 1652 |
# File 'lib/imgui.rb', line 1650 def GetBoolRef(key, default_val = false) ImGui::ImGuiStorage_GetBoolRef(self, key, default_val) end |
#GetFloat(key, default_val = 0.0) ⇒ Object
1654 1655 1656 |
# File 'lib/imgui.rb', line 1654 def GetFloat(key, default_val = 0.0) ImGui::ImGuiStorage_GetFloat(self, key, default_val) end |
#GetFloatRef(key, default_val = 0.0) ⇒ Object
1658 1659 1660 |
# File 'lib/imgui.rb', line 1658 def GetFloatRef(key, default_val = 0.0) ImGui::ImGuiStorage_GetFloatRef(self, key, default_val) end |
#GetInt(key, default_val = 0) ⇒ Object
1662 1663 1664 |
# File 'lib/imgui.rb', line 1662 def GetInt(key, default_val = 0) ImGui::ImGuiStorage_GetInt(self, key, default_val) end |
#GetIntRef(key, default_val = 0) ⇒ Object
1666 1667 1668 |
# File 'lib/imgui.rb', line 1666 def GetIntRef(key, default_val = 0) ImGui::ImGuiStorage_GetIntRef(self, key, default_val) end |
#GetVoidPtr(key) ⇒ Object
1670 1671 1672 |
# File 'lib/imgui.rb', line 1670 def GetVoidPtr(key) ImGui::ImGuiStorage_GetVoidPtr(self, key) end |
#GetVoidPtrRef(key, default_val = nil) ⇒ Object
1674 1675 1676 |
# File 'lib/imgui.rb', line 1674 def GetVoidPtrRef(key, default_val = nil) ImGui::ImGuiStorage_GetVoidPtrRef(self, key, default_val) end |
#SetAllInt(val) ⇒ Object
1678 1679 1680 |
# File 'lib/imgui.rb', line 1678 def SetAllInt(val) ImGui::ImGuiStorage_SetAllInt(self, val) end |
#SetBool(key, val) ⇒ Object
1682 1683 1684 |
# File 'lib/imgui.rb', line 1682 def SetBool(key, val) ImGui::ImGuiStorage_SetBool(self, key, val) end |
#SetFloat(key, val) ⇒ Object
1686 1687 1688 |
# File 'lib/imgui.rb', line 1686 def SetFloat(key, val) ImGui::ImGuiStorage_SetFloat(self, key, val) end |
#SetInt(key, val) ⇒ Object
1690 1691 1692 |
# File 'lib/imgui.rb', line 1690 def SetInt(key, val) ImGui::ImGuiStorage_SetInt(self, key, val) end |
#SetVoidPtr(key, val) ⇒ Object
1694 1695 1696 |
# File 'lib/imgui.rb', line 1694 def SetVoidPtr(key, val) ImGui::ImGuiStorage_SetVoidPtr(self, key, val) end |