Class: ImGuiStorage

Inherits:
FFI::Struct
  • Object
show all
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

Instance Method Details

#BuildSortByKeyObject



2120
2121
2122
# File 'lib/imgui.rb', line 2120

def BuildSortByKey()
  ImGui::ImGuiStorage_BuildSortByKey(self)
end

#ClearObject



2124
2125
2126
# File 'lib/imgui.rb', line 2124

def Clear()
  ImGui::ImGuiStorage_Clear(self)
end

#GetBool(key, default_val = false) ⇒ Object



2128
2129
2130
# File 'lib/imgui.rb', line 2128

def GetBool(key, default_val = false)
  ImGui::ImGuiStorage_GetBool(self, key, default_val)
end

#GetBoolRef(key, default_val = false) ⇒ Object



2132
2133
2134
# File 'lib/imgui.rb', line 2132

def GetBoolRef(key, default_val = false)
  ImGui::ImGuiStorage_GetBoolRef(self, key, default_val)
end

#GetFloat(key, default_val = 0.0) ⇒ Object



2136
2137
2138
# File 'lib/imgui.rb', line 2136

def GetFloat(key, default_val = 0.0)
  ImGui::ImGuiStorage_GetFloat(self, key, default_val)
end

#GetFloatRef(key, default_val = 0.0) ⇒ Object



2140
2141
2142
# File 'lib/imgui.rb', line 2140

def GetFloatRef(key, default_val = 0.0)
  ImGui::ImGuiStorage_GetFloatRef(self, key, default_val)
end

#GetInt(key, default_val = 0) ⇒ Object



2144
2145
2146
# File 'lib/imgui.rb', line 2144

def GetInt(key, default_val = 0)
  ImGui::ImGuiStorage_GetInt(self, key, default_val)
end

#GetIntRef(key, default_val = 0) ⇒ Object



2148
2149
2150
# File 'lib/imgui.rb', line 2148

def GetIntRef(key, default_val = 0)
  ImGui::ImGuiStorage_GetIntRef(self, key, default_val)
end

#GetVoidPtr(key) ⇒ Object



2152
2153
2154
# File 'lib/imgui.rb', line 2152

def GetVoidPtr(key)
  ImGui::ImGuiStorage_GetVoidPtr(self, key)
end

#GetVoidPtrRef(key, default_val = nil) ⇒ Object



2156
2157
2158
# File 'lib/imgui.rb', line 2156

def GetVoidPtrRef(key, default_val = nil)
  ImGui::ImGuiStorage_GetVoidPtrRef(self, key, default_val)
end

#SetAllInt(val) ⇒ Object



2160
2161
2162
# File 'lib/imgui.rb', line 2160

def SetAllInt(val)
  ImGui::ImGuiStorage_SetAllInt(self, val)
end

#SetBool(key, val) ⇒ Object



2164
2165
2166
# File 'lib/imgui.rb', line 2164

def SetBool(key, val)
  ImGui::ImGuiStorage_SetBool(self, key, val)
end

#SetFloat(key, val) ⇒ Object



2168
2169
2170
# File 'lib/imgui.rb', line 2168

def SetFloat(key, val)
  ImGui::ImGuiStorage_SetFloat(self, key, val)
end

#SetInt(key, val) ⇒ Object



2172
2173
2174
# File 'lib/imgui.rb', line 2172

def SetInt(key, val)
  ImGui::ImGuiStorage_SetInt(self, key, val)
end

#SetVoidPtr(key, val) ⇒ Object



2176
2177
2178
# File 'lib/imgui.rb', line 2176

def SetVoidPtr(key, val)
  ImGui::ImGuiStorage_SetVoidPtr(self, key, val)
end