Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
ImGuiAngelscript.cpp
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2022 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
26
27#include "AngelScriptBindings.h"
28#include "OgreImGui.h"
29#include "scriptarray/scriptarray.h"
30#include "ScriptEngine.h"
32
33#include <angelscript.h>
34#include <Ogre.h>
35#include <string>
36
37using namespace AngelScript;
38using namespace Ogre;
39using namespace std;
40using namespace ImGuiAngelscriptWrappers;
41
42void RoR::RegisterImGuiNativeBindings(AngelScript::asIScriptEngine* engine)
43{
44 // NOTE: enums and the ImDrawList object type are registered in RegisterImGuiCommonBindings()
45
46 // ImDrawList object (global namespace)
47 engine->RegisterObjectMethod("ImDrawList", "void AddLine(const vector2&in p1, const vector2&in p2, const color&in col, float thickness = 1.f)", asFUNCTION(ImDrawList_AddLine), asCALL_CDECL_OBJFIRST);
48 engine->RegisterObjectMethod("ImDrawList", "void AddTriangle(const vector2&in p1, const vector2&in p2, const vector2&in p3, const color&in col, float thickness = 1.f)", asFUNCTION(ImDrawList_AddTriangle), asCALL_CDECL_OBJFIRST);
49 engine->RegisterObjectMethod("ImDrawList", "void AddTriangleFilled(const vector2&in p1, const vector2&in p2, const vector2&in p3, const color&in col)", asFUNCTION(ImDrawList_AddTriangleFilled), asCALL_CDECL_OBJFIRST);
50 engine->RegisterObjectMethod("ImDrawList", "void AddRect(const vector2&in p_min, const vector2&in p_max, const color&in col, float rounding = 0.0f, int rounding_corners = 15, float thickness = 1.f)", asFUNCTION(ImDrawList_AddRect), asCALL_CDECL_OBJFIRST);
51 engine->RegisterObjectMethod("ImDrawList", "void AddRectFilled(const vector2&in p_min, const vector2&in p_max, const color&in col, float rounding = 0.0f, int rounding_corners = 15)", asFUNCTION(ImDrawList_AddRectFilled), asCALL_CDECL_OBJFIRST);
52 engine->RegisterObjectMethod("ImDrawList", "void AddCircle(const vector2&in center, float radius, const color&in col, int num_segments = 12, float thickness = 1.f)", asFUNCTION(ImDrawList_AddCircle), asCALL_CDECL_OBJFIRST);
53 engine->RegisterObjectMethod("ImDrawList", "void AddCircleFilled(const vector2&in center, float radius, const color&in col, int num_segments = 12)", asFUNCTION(ImDrawList_AddCircleFilled), asCALL_CDECL_OBJFIRST);
54 engine->RegisterObjectMethod("ImDrawList", "void AddText(const vector2&in pos, const color&in col, const string&in text)", asFUNCTION(ImDrawList_AddText), asCALL_CDECL_OBJFIRST);
55 engine->RegisterObjectMethod("ImDrawList", "void AddImage(const Ogre::TexturePtr&in tex, const vector2&in p_min, const vector2&in p_max, const vector2&in uv_min, const vector2&in uv_max, const color&in col)", asFUNCTION(ImDrawList_AddImage), asCALL_CDECL_OBJFIRST);
56 // FUNCTIONS (namespace ImGui)
57 engine->SetDefaultNamespace("ImGui");
58
59 // > Windows
60 engine->RegisterGlobalFunction("bool Begin(const string&in, bool&inout, int=0)", asFUNCTION(ImGui_Begin), asCALL_CDECL);
61 engine->RegisterGlobalFunction("void End()", asFUNCTIONPR(ImGui::End, (), void), asCALL_CDECL);
62
63 // > Child windows
64 engine->RegisterGlobalFunction("bool BeginChild(const string&in, const vector2&in=vector2(0,0), bool=false, int=0)", asFUNCTION(ImGui_BeginChild), asCALL_CDECL);
65 engine->RegisterGlobalFunction("bool BeginChild(uint, const vector2&in=vector2(0,0), bool=false, int=0)", asFUNCTION(ImGui_BeginChildById), asCALL_CDECL);
66 engine->RegisterGlobalFunction("void EndChild()", asFUNCTIONPR(ImGui::EndChild, (), void), asCALL_CDECL);
67 engine->RegisterGlobalFunction("ImDrawList@ GetWindowDrawList()", asFUNCTIONPR(ImGui::GetWindowDrawList, (), ImDrawList*), asCALL_CDECL);
68 engine->RegisterGlobalFunction("void PushStyleVar(int index, float val)", asFUNCTION(ImGui_PushStyleVarFloat), asCALL_CDECL);
69 engine->RegisterGlobalFunction("void PushStyleVar(int index, const vector2&in val)", asFUNCTION(ImGui_PushStyleVarVector2), asCALL_CDECL);
70 engine->RegisterGlobalFunction("void PopStyleVar(int count = 1)", asFUNCTIONPR(ImGui::PopStyleVar, (int), void), asCALL_CDECL);
71 engine->RegisterGlobalFunction("void PushStyleColor(int index, const color&in color)", asFUNCTION(ImGui_PushStyleColor), asCALL_CDECL);
72 engine->RegisterGlobalFunction("void PopStyleColor(int count = 1)", asFUNCTIONPR(ImGui::PopStyleColor, (int), void), asCALL_CDECL);
73 engine->RegisterGlobalFunction("void SetNextItemWidth(float)", asFUNCTIONPR(ImGui::SetNextItemWidth, (float), void), asCALL_CDECL);
74 engine->RegisterGlobalFunction("void SetNextItemOpen(bool, ImGuiCond)", asFUNCTIONPR(ImGui::SetNextItemOpen, (bool, int), void), asCALL_CDECL);
75
76 engine->RegisterGlobalFunction("vector2 GetContentRegionMax()", asFUNCTION(ImGui_GetContentRegionMax), asCALL_CDECL);
77 engine->RegisterGlobalFunction("vector2 GetContentRegionAvail()", asFUNCTION(ImGui_GetContentRegionAvail), asCALL_CDECL);
78 engine->RegisterGlobalFunction("float GetContentRegionAvailWidth()", asFUNCTIONPR(ImGui::GetContentRegionAvailWidth, (), float), asCALL_CDECL);
79 engine->RegisterGlobalFunction("vector2 GetWindowContentRegionMin()", asFUNCTION(ImGui_GetWindowContentRegionMin), asCALL_CDECL);
80 engine->RegisterGlobalFunction("vector2 GetWindowContentRegionMax()", asFUNCTION(ImGui_GetWindowContentRegionMax), asCALL_CDECL);
81 engine->RegisterGlobalFunction("float GetWindowRegionWidth()", asFUNCTIONPR(ImGui::GetWindowContentRegionWidth, (), float), asCALL_CDECL);
82
83 engine->RegisterGlobalFunction("vector2 GetWindowPos()", asFUNCTION(ImGui_GetWindowPos), asCALL_CDECL);
84 engine->RegisterGlobalFunction("vector2 GetWindowSize()", asFUNCTION(ImGui_GetWindowSize), asCALL_CDECL);
85 engine->RegisterGlobalFunction("float GetWindowWidth()", asFUNCTIONPR(ImGui::GetWindowWidth, (), float), asCALL_CDECL);
86 engine->RegisterGlobalFunction("float GetWindowHeight()", asFUNCTIONPR(ImGui::GetWindowHeight, (), float), asCALL_CDECL);
87 engine->RegisterGlobalFunction("bool IsWindowCollapsed()", asFUNCTIONPR(ImGui::IsWindowCollapsed, (), bool), asCALL_CDECL);
88 // engine->RegisterGlobalFunction("bool IsWindowAppearing()", asFUNCTIONPR(ImGui::IsWindowAppearing, (), bool), asCALL_CDECL);
89 engine->RegisterGlobalFunction("void SetWindowFontScale(float)", asFUNCTIONPR(ImGui::SetWindowFontScale, (float), void), asCALL_CDECL);
90
91 engine->RegisterGlobalFunction("void SetNextWindowPos(vector2, int=0, vector2=vector2(0,0))", asFUNCTION(ImGui_SetNextWindowPos), asCALL_CDECL);
92 engine->RegisterGlobalFunction("void SetNextWindowSize(vector2)", asFUNCTION(ImGui_SetNextWindowSize), asCALL_CDECL);
93 engine->RegisterGlobalFunction("void SetNextWindowContentSize(vector2)", asFUNCTION(ImGui_SetNextWindowContentSize), asCALL_CDECL);
94 engine->RegisterGlobalFunction("void SetNextWindowCollapsed(bool)", asFUNCTION(ImGui_SetNextWindowCollapsed), asCALL_CDECL);
95 engine->RegisterGlobalFunction("void SetNextWindowFocus()", asFUNCTION(ImGui_SetNextWindowFocus), asCALL_CDECL);
96 engine->RegisterGlobalFunction("void SetWindowPos(vector2)", asFUNCTION(ImGui_SetWindowPos), asCALL_CDECL);
97 engine->RegisterGlobalFunction("void SetWindowSize(vector2)", asFUNCTION(ImGui_SetWindowSize), asCALL_CDECL);
98 engine->RegisterGlobalFunction("void SetWindowCollapsed(bool)", asFUNCTION(ImGui_SetWindowCollapsed), asCALL_CDECL);
99 engine->RegisterGlobalFunction("void SetWindowFocus()", asFUNCTION(ImGui_SetWindowFocus), asCALL_CDECL);
100
101 engine->RegisterGlobalFunction("void SetWindowPos(const string&in, vector2)", asFUNCTION(ImGui_SetWindowPosByName), asCALL_CDECL);
102 engine->RegisterGlobalFunction("void SetWindowSize(const string&in, vector2)", asFUNCTION(ImGui_SetWindowSizeByName), asCALL_CDECL);
103 engine->RegisterGlobalFunction("void SetWindowCollapsed(const string&in, bool)", asFUNCTION(ImGui_SetWindowCollapsedByName), asCALL_CDECL);
104 engine->RegisterGlobalFunction("void SetWindowFocus(const string&in)", asFUNCTION(ImGui_SetWindowFocusByName), asCALL_CDECL);
105
106 engine->RegisterGlobalFunction("float GetScrollX()", asFUNCTIONPR(ImGui::GetScrollX, (), float), asCALL_CDECL);
107 engine->RegisterGlobalFunction("float GetScrollY()", asFUNCTIONPR(ImGui::GetScrollY, (), float), asCALL_CDECL);
108 engine->RegisterGlobalFunction("float GetScrollMaxX()", asFUNCTIONPR(ImGui::GetScrollMaxX, (), float), asCALL_CDECL);
109 engine->RegisterGlobalFunction("float GetScrollMaxY()", asFUNCTIONPR(ImGui::GetScrollMaxY, (), float), asCALL_CDECL);
110 engine->RegisterGlobalFunction("void SetScrollX(float)", asFUNCTIONPR(ImGui::SetScrollX, (float), void), asCALL_CDECL);
111 engine->RegisterGlobalFunction("void SetScrollY(float)", asFUNCTIONPR(ImGui::SetScrollY, (float), void), asCALL_CDECL);
112 engine->RegisterGlobalFunction("void SetScrollHere(float = 0.5f)", asFUNCTIONPR(ImGui::SetScrollHere, (float), void), asCALL_CDECL);
113 engine->RegisterGlobalFunction("void SetScrollFromPosY(float, float = 0.5f)", asFUNCTIONPR(ImGui::SetScrollFromPosY, (float,float), void), asCALL_CDECL);
114
115 engine->RegisterGlobalFunction("void Separator()", asFUNCTIONPR(ImGui::Separator, (), void), asCALL_CDECL);
116 engine->RegisterGlobalFunction("void SameLine(float = 0.0f, float = -1.0f)", asFUNCTIONPR(ImGui::SameLine, (float,float), void), asCALL_CDECL);
117 engine->RegisterGlobalFunction("void NewLine()", asFUNCTIONPR(ImGui::NewLine, (), void), asCALL_CDECL);
118 engine->RegisterGlobalFunction("void Spacing()", asFUNCTIONPR(ImGui::Spacing, (), void), asCALL_CDECL);
119 engine->RegisterGlobalFunction("void Dummy(vector2)", asFUNCTION(ImGui_Dummy), asCALL_CDECL);
120 engine->RegisterGlobalFunction("void Indent(float = 0.0f)", asFUNCTIONPR(ImGui::Indent, (float), void), asCALL_CDECL);
121 engine->RegisterGlobalFunction("void Unindent(float = 0.0f)", asFUNCTIONPR(ImGui::Unindent, (float), void), asCALL_CDECL);
122 engine->RegisterGlobalFunction("void BeginGroup()", asFUNCTIONPR(ImGui::BeginGroup, (), void), asCALL_CDECL);
123 engine->RegisterGlobalFunction("void EndGroup()", asFUNCTIONPR(ImGui::EndGroup, (), void), asCALL_CDECL);
124 engine->RegisterGlobalFunction("vector2 GetCursorPos()", asFUNCTION(ImGui_GetCursorPos), asCALL_CDECL);
125 engine->RegisterGlobalFunction("float GetCursorPosX()", asFUNCTIONPR(ImGui::GetCursorPosX, (), float), asCALL_CDECL);
126 engine->RegisterGlobalFunction("float GetCursorPosY()", asFUNCTIONPR(ImGui::GetCursorPosY, (), float), asCALL_CDECL);
127 engine->RegisterGlobalFunction("void SetCursorPos(vector2)", asFUNCTION(ImGui_SetCursorPos), asCALL_CDECL);
128 engine->RegisterGlobalFunction("void SetCursorPosX(float)", asFUNCTIONPR(ImGui::SetCursorPosX, (float), void), asCALL_CDECL);
129 engine->RegisterGlobalFunction("void SetCursorPosY(float)", asFUNCTIONPR(ImGui::SetCursorPosY, (float), void), asCALL_CDECL);
130 engine->RegisterGlobalFunction("vector2 GetCursorStartPos()", asFUNCTION(ImGui_GetCursorStartPos), asCALL_CDECL);
131 engine->RegisterGlobalFunction("vector2 GetCursorScreenPos()", asFUNCTION(ImGui_GetCursorScreenPos), asCALL_CDECL);
132 engine->RegisterGlobalFunction("void SetCursorScreenPos(vector2)", asFUNCTION(ImGui_SetCursorScreenPos), asCALL_CDECL);
133 engine->RegisterGlobalFunction("void AlignTextToFramePadding()", asFUNCTIONPR(ImGui::AlignTextToFramePadding, (), void), asCALL_CDECL);
134 engine->RegisterGlobalFunction("float GetTextLineHeight()", asFUNCTIONPR(ImGui::GetTextLineHeight, (), float), asCALL_CDECL);
135 engine->RegisterGlobalFunction("float GetTextLineHeightWithSpacing()", asFUNCTIONPR(ImGui::GetTextLineHeightWithSpacing, (), float), asCALL_CDECL);
136 // engine->RegisterGlobalFunction("float GetFrameHeight()", asFUNCTIONPR(ImGui::GetFrameHeight, (), float), asCALL_CDECL);
137 // engine->RegisterGlobalFunction("float GetFrameHeightWithSpacing()", asFUNCTIONPR(ImGui::GetFrameHeightWithSpacing, (), float), asCALL_CDECL);
138
139 // Columns (considered legacy in latest versions - superseded by Tables!)
140 engine->RegisterGlobalFunction("void Columns(int = 1, const string&in = string(), bool = true)", asFUNCTION(ImGui_Columns), asCALL_CDECL);
141 engine->RegisterGlobalFunction("void NextColumn()", asFUNCTION(ImGui_NextColumn), asCALL_CDECL);
142 engine->RegisterGlobalFunction("int GetColumnIndex()", asFUNCTION(ImGui_GetColumnIndex), asCALL_CDECL);
143 engine->RegisterGlobalFunction("float GetColumnWidth(int = -1)", asFUNCTION(ImGui_GetColumnWidth), asCALL_CDECL);
144 // engine->RegisterGlobalFunction("void SetColumnWidth(int, float)", asFUNCTIONPR([](int a, float b) { ImGui::SetColumnWidth(a, b); }, (int,float), void), asCALL_CDECL);
145 engine->RegisterGlobalFunction("float GetColumnOffset(int = -1)", asFUNCTION(ImGui_GetColumnOffset), asCALL_CDECL);
146 engine->RegisterGlobalFunction("void SetColumnOffset(int, float)", asFUNCTION(ImGui_SetColumnOffset), asCALL_CDECL);
147 engine->RegisterGlobalFunction("int GetColumnsCount()", asFUNCTION(ImGui_GetColumnsCount), asCALL_CDECL);
148
149
150 // Tab bars, tabs
151 engine->RegisterGlobalFunction("bool BeginTabBar(const string&in, int = 0)", asFUNCTION(ImGui_BeginTabBar), asCALL_CDECL);
152 engine->RegisterGlobalFunction("void EndTabBar()", asFUNCTION(ImGui::EndTabBar), asCALL_CDECL);
153 // BeginTabItem() without X close button.
154 engine->RegisterGlobalFunction("bool BeginTabItem(const string&in, int = 0)", asFUNCTION(ImGui_BeginTabItem), asCALL_CDECL);
155 // BeginTabItem() with X close button.
156 engine->RegisterGlobalFunction("bool BeginTabItem(const string&in, bool&inout, int = 0)", asFUNCTION(ImGui_BeginTabItemClosable), asCALL_CDECL);
157 engine->RegisterGlobalFunction("void EndTabItem()", asFUNCTION(ImGui::EndTabItem), asCALL_CDECL);
158 //engine->RegisterGlobalFunction("bool TabItemButton(const string&in, ImGuiTabItemFlags = 0)", asFUNCTIONPR([](const string& label, ImGuiTabItemFlags flags) { return ImGui::TabItemButton(label.c_str(), flags); }, (const string&, ImGuiTabItemFlags), bool), asCALL_CDECL);
159 engine->RegisterGlobalFunction("void SetTabItemClosed(const string&in)", asFUNCTION(ImGui_SetTabItemClosed), asCALL_CDECL);
160
161
162 // ID scopes
163 engine->RegisterGlobalFunction("void PushID(const string&in)", asFUNCTION(ImGui_PushIDStr), asCALL_CDECL);
164 engine->RegisterGlobalFunction("void PushID(int int_id)", asFUNCTION(ImGui_PushIDInt), asCALL_CDECL);
165 engine->RegisterGlobalFunction("void PopID()", asFUNCTIONPR(ImGui::PopID, (), void), asCALL_CDECL);
166 engine->RegisterGlobalFunction("uint GetID(const string&in)", asFUNCTION(ImGui_GetID), asCALL_CDECL);
167
168 // Widgets: Text
169 engine->RegisterGlobalFunction("void Text(const string&in)", asFUNCTION(ImGui_Text), asCALL_CDECL);
170 engine->RegisterGlobalFunction("void TextDisabled(const string&in)", asFUNCTION(ImGui_TextDisabled), asCALL_CDECL);
171 engine->RegisterGlobalFunction("void TextColored(color col, const string&in)", asFUNCTION(ImGui_TextColored), asCALL_CDECL);
172 engine->RegisterGlobalFunction("void TextWrapped(const string&in)", asFUNCTION(ImGui_TextWrapped), asCALL_CDECL);
173 engine->RegisterGlobalFunction("void LabelText(const string&in, const string&in)", asFUNCTION(ImGui_LabelText), asCALL_CDECL);
174 engine->RegisterGlobalFunction("void Bullet()", asFUNCTIONPR(ImGui::Bullet, (), void), asCALL_CDECL);
175 engine->RegisterGlobalFunction("void BulletText(const string&in)", asFUNCTION(ImGui_BulletText), asCALL_CDECL);
176
177 // Widgets: Main
178 engine->RegisterGlobalFunction("bool Button(const string&in, vector2 = vector2(0,0))", asFUNCTION(ImGui_Button), asCALL_CDECL);
179 engine->RegisterGlobalFunction("bool SmallButton(const string&in)", asFUNCTION(ImGui_SmallButton), asCALL_CDECL);
180 engine->RegisterGlobalFunction("bool InvisibleButton(const string&in, vector2)", asFUNCTION(ImGui_InvisibleButton), asCALL_CDECL);
181 engine->RegisterGlobalFunction("void Image(const Ogre::TexturePtr&in, vector2)", asFUNCTION(ImGui_Image), asCALL_CDECL);
182 engine->RegisterGlobalFunction("bool Checkbox(const string&in, bool&inout)", asFUNCTION(ImGui_Checkbox), asCALL_CDECL);
183 engine->RegisterGlobalFunction("bool CheckboxFlags(const string&in, uint&inout, uint)", asFUNCTION(ImGui_CheckboxFlags), asCALL_CDECL);
184 engine->RegisterGlobalFunction("bool RadioButton(const string&in, bool)", asFUNCTION(ImGui_RadioButton), asCALL_CDECL);
185 engine->RegisterGlobalFunction("bool RadioButton(const string&in, int&inout, int)", asFUNCTION(ImGui_RadioButtonInt), asCALL_CDECL);
186 engine->RegisterGlobalFunction("void ProgressBar(float, vector2=vector2(-1,0), const string&in = \"\")", asFUNCTION(ImGui_ProgressBar), asCALL_CDECL);
187
188
189 // Widgets: Combo Box
190 // engine->RegisterGlobalFunction("bool BeginCombo(const string&in, const string&in, int = 0)", asFUNCTIONPR([](const string& id, const string& prevItem, int flags) { return ImGui::BeginCombo(id.c_str(), prevItem.c_str(), flags); }, (const string&, const string&, int), bool), asCALL_CDECL);
191 // engine->RegisterGlobalFunction("void EndCombo()", asFUNCTIONPR(ImGui::EndCombo, (), void), asCALL_CDECL);
192 /*
193 static char imgui_comboItem[4096];
194 engine->RegisterGlobalFunction("bool Combo(const string&in, int&inout, const Array<string>@+)", asFUNCTIONPR([](const string& lbl, int& index, const CScriptArray* items) {
195 memset(imgui_comboItem, 0, sizeof(char) * 4096);
196 unsigned offset = 0;
197 for (unsigned i = 0; i < items->GetSize(); ++i)
198 {
199 string* str = ((string*)items->At(i));
200 strcpy(imgui_comboItem + offset, str->c_str());
201 offset += str->length() + 1;
202 }
203 return ImGui::Combo(lbl.c_str(), &index, imgui_comboItem, -1);
204 }, (const string&, int&, const CScriptArray*), bool), asCALL_CDECL);
205 */
206 // Widgets: Drags
207 engine->RegisterGlobalFunction("bool DragFloat(const string&in, float&inout, float = 1.0f, float = 0.0f, float = 0.0f)", asFUNCTION(ImGui_DragFloat), asCALL_CDECL);
208 engine->RegisterGlobalFunction("bool DragFloat2(const string&in, vector2&inout)", asFUNCTION(ImGui_DragFloat2), asCALL_CDECL);
209 engine->RegisterGlobalFunction("bool DragFloat3(const string&in, vector3&inout)", asFUNCTION(ImGui_DragFloat3), asCALL_CDECL);
210 /* --- TODO: Register Vector4
211 engine->RegisterGlobalFunction("bool DragFloat4(const string&in, Vector4&inout)", asFUNCTIONPR([](const string& n, Vector4& v) {
212 return ImGui::DragFloat4(n.c_str(), &v.x); }, (const string&, Vector4&), bool), asCALL_CDECL);
213 engine->RegisterGlobalFunction("bool DragInt(const string&in, int&inout, int = 0, int = 0)", asFUNCTIONPR([](const string& n, int& v, int mn, int mx) {
214 return ImGui::DragInt(n.c_str(), &v, 1.0f, mn, mx); }, (const string&, int&, int, int), bool), asCALL_CDECL);
215 engine->RegisterGlobalFunction("bool DragInt2(const string&in, IntVector2&inout, int = 0, int = 0)", asFUNCTIONPR([](const string& n, IntVector2& v, int mn, int mx) {
216 return ImGui::DragInt2(n.c_str(), &v.x, 1.0f, mn, mx); }, (const string&, IntVector2&, int,int), bool), asCALL_CDECL);
217 engine->RegisterGlobalFunction("bool DragInt3(const string&in, IntVector3&inout, int = 0, int = 0)", asFUNCTIONPR([](const string& n, IntVector3& v, int mn, int mx) {
218 return ImGui::DragInt3(n.c_str(), &v.x, 1.0f, mn, mx); }, (const string&, IntVector3&, int,int), bool), asCALL_CDECL);
219 */
220 engine->RegisterGlobalFunction("bool DragFloatRange2(const string&in, float&inout, float&inout, float = 0.0f, float = 1.0f)", asFUNCTION(ImGui_DragFloatRange2), asCALL_CDECL);
221 engine->RegisterGlobalFunction("bool DragIntRange2(const string&in, int&inout, int&inout, int, int)", asFUNCTION(ImGui_DragIntRange2), asCALL_CDECL);
222
223 // Widgets: Input with Keyboard
224 engine->RegisterGlobalFunction("bool InputText(const string&in, string&inout)", asFUNCTION(ImGui_InputText), asCALL_CDECL);
225 engine->RegisterGlobalFunction("bool InputTextMultiline(const string&in, string&inout, const vector2&in = vector2(0,0))", asFUNCTION(ImGui_InputTextMultiline), asCALL_CDECL);
226 engine->RegisterGlobalFunction("bool InputFloat(const string&, float&inout)", asFUNCTION(ImGui_InputFloat), asCALL_CDECL);
227 engine->RegisterGlobalFunction("bool InputFloat2(const string&, vector2&inout)", asFUNCTION(ImGui_InputFloat2), asCALL_CDECL);
228 engine->RegisterGlobalFunction("bool InputFloat3(const string&, vector3&inout)", asFUNCTION(ImGui_InputFloat3), asCALL_CDECL);
229 /* --- TODO: Register Vector4
230 engine->RegisterGlobalFunction("bool InputFloat4(const string&, Vector4&inout)", asFUNCTIONPR([](const string& id, Vector4& val) {
231 return ImGui::InputFloat4(id.c_str(), &val.x_); }, (const string&, Vector4&),bool), asCALL_CDECL);
232 */
233 engine->RegisterGlobalFunction("bool InputInt(const string&, int&inout)", asFUNCTION(ImGui_InputInt), asCALL_CDECL);
234 /*
235 engine->RegisterGlobalFunction("bool InputInt2(const string&, IntVector2&inout)", asFUNCTIONPR([](const string& id, IntVector2& val) {
236 return ImGui::InputInt2(id.c_str(), &val.x_); }, (const string&, IntVector2&),bool), asCALL_CDECL);
237 engine->RegisterGlobalFunction("bool InputInt3(const string&, IntVector3&inout)", asFUNCTIONPR([](const string& id, IntVector3& val) {
238 return ImGui::InputInt3(id.c_str(), &val.x_); }, (const string&, IntVector3&), bool), asCALL_CDECL);
239 */
240
241 // Widgets: Sliders (tip: ctrl+click on a slider to input with keyboard. manually input values aren't clamped, can go off-bounds)
242 engine->RegisterGlobalFunction("bool SliderFloat(const string&in, float&inout, float = 0.0f, float = 0.0f)", asFUNCTION(ImGui_SliderFloat), asCALL_CDECL);
243 engine->RegisterGlobalFunction("bool SliderFloat2(const string&in, vector2&inout, float, float)", asFUNCTION(ImGui_SliderFloat2), asCALL_CDECL);
244 engine->RegisterGlobalFunction("bool SliderFloat3(const string&in, vector3&inout, float, float)", asFUNCTION(ImGui_SliderFloat3), asCALL_CDECL);
245 engine->RegisterGlobalFunction("bool SliderInt(const string&in, int&inout, int = 0, int = 0)", asFUNCTION(ImGui_SliderInt), asCALL_CDECL);
246/* --- TODO: Register Vector4
247 engine->RegisterGlobalFunction("bool SliderFloat4(const string&in, Vector4&inout, float, float)", asFUNCTIONPR([](const string& n, Vector4& v, float mn, float mx) {
248 return ImGui::SliderFloat4(n.c_str(), &v.x, mn, mx); }, (const string&, Vector4&,float,float),bool), asCALL_CDECL);
249
250 engine->RegisterGlobalFunction("bool SliderInt2(const string&in, IntVector2&inout, int = 0, int = 0)", asFUNCTIONPR([](const string& n, IntVector2& v, int mn, int mx) {
251 return ImGui::SliderInt2(n.c_str(), &v.x, mn, mx); }, (const string&, IntVector2&, int,int),bool), asCALL_CDECL);
252 engine->RegisterGlobalFunction("bool SliderInt3(const string&in, IntVector3&inout, int = 0, int = 0)", asFUNCTIONPR([](const string& n, IntVector3& v, int mn, int mx) {
253 return ImGui::SliderInt3(n.c_str(), &v.x, mn, mx); }, (const string&, IntVector3&, int,int),bool), asCALL_CDECL);
254 */
255
256 // Widgets: Color Editor/Picker
257 engine->RegisterGlobalFunction("bool ColorEdit3(const string&in, color&inout)", asFUNCTION(ImGui_ColorEdit3), asCALL_CDECL);
258 engine->RegisterGlobalFunction("bool ColorEdit4(const string&in, color&inout)", asFUNCTION(ImGui_ColorEdit4), asCALL_CDECL);
259 /* engine->RegisterGlobalFunction("bool ColorPicker3(const string&in, color&inout)", asFUNCTIONPR([](const string& id, ColourValue& val) {
260 Vector3 v(val.r, val.g, val.b);
261 if (ImGui::ColorPicker3(id.c_str(), &v.x))
262 {
263 val = ColourValue(v.x, v.y, v.z);
264 return true;
265 }
266 return false;
267 }, (const string&, ColourValue&),bool), asCALL_CDECL);
268 engine->RegisterGlobalFunction("bool ColorPicker4(const string&in, color&inout)", asFUNCTIONPR([](const string& id, ColourValue& val) {
269 Vector4 v(val.r, val.g, val.b, val.a);
270 if (ImGui::ColorPicker4(id.c_str(), &v.x))
271 {
272 val = ColourValue(v.x, v.y, v.z, v.w);
273 return true;
274 }
275 return false;
276 }, (const string&, ColourValue&),bool), asCALL_CDECL);*/
277 engine->RegisterGlobalFunction("bool ColorButton(const string&in, color)", asFUNCTION(ImGui_ColorButton), asCALL_CDECL);
278
279 // Widgets: Trees
280 engine->RegisterGlobalFunction("bool TreeNode(const string&in)", asFUNCTION(ImGui_TreeNode), asCALL_CDECL);
281 engine->RegisterGlobalFunction("void TreePush(const string&in)", asFUNCTION(ImGui_TreePush), asCALL_CDECL);
282 engine->RegisterGlobalFunction("void TreePop()", asFUNCTIONPR(ImGui::TreePop, (), void), asCALL_CDECL);
283 engine->RegisterGlobalFunction("void TreeAdvanceToLabelPos()", asFUNCTIONPR(ImGui::TreeAdvanceToLabelPos, (), void), asCALL_CDECL);
284 engine->RegisterGlobalFunction("float GetTreeNodeToLabelSpacing()", asFUNCTIONPR(ImGui::GetTreeNodeToLabelSpacing, (), float), asCALL_CDECL);
285 engine->RegisterGlobalFunction("void SetNextTreeNodeOpen(bool)", asFUNCTION(ImGui_SetNextTreeNodeOpen), asCALL_CDECL);
286 engine->RegisterGlobalFunction("bool CollapsingHeader(const string&in)", asFUNCTION(ImGui_CollapsingHeader), asCALL_CDECL);
287 engine->RegisterGlobalFunction("bool CollapsingHeader(const string&in, bool&inout)", asFUNCTION(ImGui_CollapsingHeaderClosable), asCALL_CDECL);
288
289 // Widgets: Selectable / Lists
290 engine->RegisterGlobalFunction("bool Selectable(const string&in, bool = false)", asFUNCTION(ImGui_Selectable), asCALL_CDECL);
291 engine->RegisterGlobalFunction("bool ListBoxHeader(const string&in)", asFUNCTION(ImGui_ListBoxHeader), asCALL_CDECL);
292
293 // Values
294 engine->RegisterGlobalFunction("void Value(const string&in, bool)", asFUNCTION(ImGui_ValueBool), asCALL_CDECL);
295 engine->RegisterGlobalFunction("void Value(const string&in, int)", asFUNCTION(ImGui_ValueInt), asCALL_CDECL);
296 engine->RegisterGlobalFunction("void Value(const string&in, uint)", asFUNCTION(ImGui_ValueUint), asCALL_CDECL);
297 engine->RegisterGlobalFunction("void Value(const string&in, float)", asFUNCTION(ImGui_ValueFloat), asCALL_CDECL);
298
299 // Tooltips
300 engine->RegisterGlobalFunction("void BeginTooltip()", asFUNCTIONPR(ImGui::BeginTooltip , (), void), asCALL_CDECL);
301 engine->RegisterGlobalFunction("void EndTooltip()", asFUNCTIONPR(ImGui::EndTooltip , (), void), asCALL_CDECL);
302 engine->RegisterGlobalFunction("void SetTooltip(const string&in)", asFUNCTION(ImGui_SetTooltip), asCALL_CDECL);
303
304 // Menus
305 engine->RegisterGlobalFunction("bool BeginMainMenuBar()", asFUNCTION(ImGui_BeginMainMenuBar), asCALL_CDECL);
306 engine->RegisterGlobalFunction("void EndMainMenuBar()", asFUNCTION(ImGui_EndMainMenuBar), asCALL_CDECL);
307 engine->RegisterGlobalFunction("bool BeginMenuBar()", asFUNCTION(ImGui_BeginMenuBar), asCALL_CDECL);
308 engine->RegisterGlobalFunction("void EndMenuBar()", asFUNCTION(ImGui_EndMenuBar), asCALL_CDECL);
309 engine->RegisterGlobalFunction("bool BeginMenu(const string&in, bool = true)", asFUNCTION(ImGui_BeginMenu), asCALL_CDECL);
310 engine->RegisterGlobalFunction("void EndMenu()", asFUNCTION(ImGui_EndMenu), asCALL_CDECL);
311 engine->RegisterGlobalFunction("bool MenuItem(const string&in, const string&in = string(), bool = false, bool = true)", asFUNCTION(ImGui_MenuItem), asCALL_CDECL);
312 engine->RegisterGlobalFunction("bool MenuItem(const string&in, const string&in, bool &inout, bool = true)", asFUNCTION(ImGui_MenuItemToggle), asCALL_CDECL);
313
314 // Popups
315 engine->RegisterGlobalFunction("void OpenPopup(const string&in)", asFUNCTION(ImGui_OpenPopup), asCALL_CDECL);
316 /* engine->RegisterGlobalFunction("bool BeginPopup(const string&in, int = 0)", asFUNCTIONPR([](const string& a, int b) {
317 return ImGui::BeginPopup(a.c_str(), (ImGuiWindowFlags)b); }, (const string&, int), bool), asCALL_CDECL);*/ // FIXME: update imgui!
318 engine->RegisterGlobalFunction("bool BeginPopup(const string&in, int = 0)", asFUNCTION(ImGui_BeginPopup), asCALL_CDECL);
319 engine->RegisterGlobalFunction("bool BeginPopupContextItem(const string&in = string(), int = 1)", asFUNCTION(ImGui_BeginPopupContextItem), asCALL_CDECL);
320 engine->RegisterGlobalFunction("bool BeginPopupContextWindow(const string&in = string(), int = 1, bool = true)", asFUNCTION(ImGui_BeginPopupContextWindow), asCALL_CDECL); // FIXME: update imgui! -- swapped args
321 engine->RegisterGlobalFunction("bool BeginPopupContextVoid(const string&in = string(), int = 1)", asFUNCTION(ImGui_BeginPopupContextVoid), asCALL_CDECL);
322 engine->RegisterGlobalFunction("bool BeginPopupModal(const string&in, bool &inout = null, int = 0)", asFUNCTION(ImGui_BeginPopupModal), asCALL_CDECL);
323 engine->RegisterGlobalFunction("void EndPopup()", asFUNCTION(ImGui_EndPopup), asCALL_CDECL);
324/* engine->RegisterGlobalFunction("bool OpenPopupOnItemClick(const string&in = string(), int = 1)", asFUNCTIONPR([](const string& a, int b) {
325 return ImGui::OpenPopupOnItemClick(a.c_str(), b); }, (const string&, int), bool), asCALL_CDECL);*/ // FIXME: update imgui!
326 /* engine->RegisterGlobalFunction("bool IsPopupOpen(const string&in)", asFUNCTIONPR([](const string& a) {
327 return ImGui::IsPopupOpen(a.c_str()); }, (const string&), bool), asCALL_CDECL); */ // FIXME: update imgui!
328 engine->RegisterGlobalFunction("void CloseCurrentPopup()", asFUNCTION(ImGui_CloseCurrentPopup), asCALL_CDECL);
329
330 // Clip-rects
331 engine->RegisterGlobalFunction("void PushClipRect(const vector2&, const vector2&, bool)", asFUNCTION(ImGui_PushClipRect), asCALL_CDECL);
332 engine->RegisterGlobalFunction("void PopClipRect()", asFUNCTION(ImGui_PopClipRect), asCALL_CDECL);
333
334 // Focus
335 /* engine->RegisterGlobalFunction("void SetItemDefaultFocus()", asFUNCTIONPR([]() { ImGui::SetItemDefaultFocus(); }, (), void), asCALL_CDECL); */ // TODO update imgui
336 engine->RegisterGlobalFunction("void SetKeyboardFocusHere(int = 0)", asFUNCTION(ImGui_SetKeyboardFocusHere), asCALL_CDECL);
337
338 // Utilities
339 engine->RegisterGlobalFunction("bool IsItemHovered(int = 0)", asFUNCTION(ImGui_IsItemHovered), asCALL_CDECL); // TODO: update imgui -- flags omitted
340 engine->RegisterGlobalFunction("bool IsItemActive()", asFUNCTION(ImGui_IsItemActive), asCALL_CDECL);
341 engine->RegisterGlobalFunction("bool IsItemClicked(int = 0)", asFUNCTION(ImGui_IsItemClicked), asCALL_CDECL);
342 engine->RegisterGlobalFunction("bool IsItemVisible()", asFUNCTION(ImGui_IsItemVisible), asCALL_CDECL);
343 engine->RegisterGlobalFunction("bool IsAnyItemHovered()", asFUNCTION(ImGui_IsAnyItemHovered), asCALL_CDECL);
344 engine->RegisterGlobalFunction("bool IsAnyItemActive()", asFUNCTION(ImGui_IsAnyItemActive), asCALL_CDECL);
345 engine->RegisterGlobalFunction("vector2 GetItemRectMin()", asFUNCTION(ImGui_GetItemRectMin), asCALL_CDECL);
346 engine->RegisterGlobalFunction("vector2 GetItemRectMax()", asFUNCTION(ImGui_GetItemRectMax), asCALL_CDECL);
347 engine->RegisterGlobalFunction("vector2 GetItemRectSize()", asFUNCTION(ImGui_GetItemRectSize), asCALL_CDECL);
348 engine->RegisterGlobalFunction("void SetItemAllowOverlap()", asFUNCTION(ImGui_SetItemAllowOverlap), asCALL_CDECL);
349 engine->RegisterGlobalFunction("bool IsWindowFocused(int = 0)", asFUNCTION(ImGui_IsWindowFocused), asCALL_CDECL); // TODO: update imgui -- flags omitted
350 engine->RegisterGlobalFunction("bool IsWindowHovered(int = 0)", asFUNCTION(ImGui_IsWindowHovered), asCALL_CDECL); // TODO: update imgui -- flags omitted
351 engine->RegisterGlobalFunction("bool IsRectVisible(const vector2&)", asFUNCTION(ImGui_IsRectVisibleSize), asCALL_CDECL);
352 engine->RegisterGlobalFunction("bool IsRectVisible(const vector2&, const vector2&)", asFUNCTION(ImGui_IsRectVisible), asCALL_CDECL);
353 engine->RegisterGlobalFunction("float GetTime()", asFUNCTION(ImGui_GetTime), asCALL_CDECL);
354 engine->RegisterGlobalFunction("int GetFrameCount()", asFUNCTION(ImGui_GetFrameCount), asCALL_CDECL);
355
356 engine->RegisterGlobalFunction("vector2 CalcTextSize(const string&in, bool hide_text_after_double_hash = false, float wrap_width = -1.0f)", asFUNCTION(ImGui_CalcTextSize), asCALL_CDECL);
357 engine->RegisterGlobalFunction("void CalcListClipping(int, float, int&inout, int&inout)", asFUNCTION(ImGui_CalcListClipping), asCALL_CDECL);
358 engine->RegisterGlobalFunction("bool BeginChildFrame(uint, const vector2&, int = 0)", asFUNCTION(ImGui_BeginChildFrame), asCALL_CDECL);
359 engine->RegisterGlobalFunction("void EndChildFrame()", asFUNCTION(ImGui_EndChildFrame), asCALL_CDECL);
360
361 engine->RegisterGlobalFunction("int GetKeyIndex(int)", asFUNCTION(ImGui_GetKeyIndex), asCALL_CDECL);
362 engine->RegisterGlobalFunction("bool IsKeyDown(int)", asFUNCTION(ImGui_IsKeyDown), asCALL_CDECL);
363 engine->RegisterGlobalFunction("bool IsKeyPressed(int, bool = true)", asFUNCTION(ImGui_IsKeyPressed), asCALL_CDECL);
364 engine->RegisterGlobalFunction("bool IsKeyReleased(int)", asFUNCTION(ImGui_IsKeyReleased), asCALL_CDECL);
365 /*engine->RegisterGlobalFunction("int GetKeyPressedAmount(int, float, float)", asFUNCTIONPR([](int a, float b, float c) { return ImGui::GetKeyPressedAmount(a, b, c); }, (int,float,float), int), asCALL_CDECL);*/ // FIXME update imgui
366 engine->RegisterGlobalFunction("bool IsMouseDown(int)", asFUNCTION(ImGui_IsMouseDown), asCALL_CDECL);
367 engine->RegisterGlobalFunction("bool IsMouseClicked(int, bool = false)", asFUNCTION(ImGui_IsMouseClicked), asCALL_CDECL);
368 engine->RegisterGlobalFunction("bool IsMouseDoubleClicked(int)", asFUNCTION(ImGui_IsMouseDoubleClicked), asCALL_CDECL);
369 engine->RegisterGlobalFunction("bool IsMouseReleased(int)", asFUNCTION(ImGui_IsMouseReleased), asCALL_CDECL);
370 engine->RegisterGlobalFunction("bool IsMouseDragging(int = 0, float = -1.0f)", asFUNCTION(ImGui_IsMouseDragging), asCALL_CDECL);
371 engine->RegisterGlobalFunction("bool IsMouseHoveringRect(const vector2&in, const vector2&in, bool = true)", asFUNCTION(ImGui_IsMouseHoveringRect), asCALL_CDECL);
372 /* engine->RegisterGlobalFunction("bool IsMousePosValid(const Vector2&in)", asFUNCTIONPR([](const Vector2& a) { auto v = ImVec2(a.x, a.y); return ImGui::IsMousePosValid(&v); }, (const Vector2&), bool), asCALL_CDECL); */ // FIXME update imgui
373 engine->RegisterGlobalFunction("vector2 GetMousePos()", asFUNCTION(ImGui_GetMousePos), asCALL_CDECL);
374 engine->RegisterGlobalFunction("vector2 GetMousePosOnOpeningCurrentPopup()", asFUNCTION(ImGui_GetMousePosOnOpeningCurrentPopup), asCALL_CDECL);
375 engine->RegisterGlobalFunction("vector2 GetMouseDragDelta(int = 0, float = -1.0f)", asFUNCTION(ImGui_GetMouseDragDelta), asCALL_CDECL);
376 engine->RegisterGlobalFunction("void ResetMouseDragDelta(int = 0)", asFUNCTION(ImGui_ResetMouseDragDelta), asCALL_CDECL);
377 engine->RegisterGlobalFunction("int GetMouseCursor()", asFUNCTION(ImGui_GetMouseCursor), asCALL_CDECL);
378 engine->RegisterGlobalFunction("void SetMouseCursor(int)", asFUNCTION(ImGui_SetMouseCursor), asCALL_CDECL);
379 engine->RegisterGlobalFunction("void CaptureKeyboardFromApp(bool = true)", asFUNCTION(ImGui_CaptureKeyboardFromApp), asCALL_CDECL);
380 engine->RegisterGlobalFunction("void CaptureMouseFromApp(bool = true)", asFUNCTION(ImGui_CaptureMouseFromApp), asCALL_CDECL);
381
382
383 engine->RegisterGlobalFunction("string GetClipboardText()", asFUNCTION(ImGui_GetClipboardText), asCALL_CDECL);
384 engine->RegisterGlobalFunction("void SetClipboardText(const string&in)", asFUNCTION(ImGui_SetClipboardText), asCALL_CDECL);
385
386 // Data plotting - we wrap the 'getter func' variant to resemble the 'float*' variant.
387 engine->RegisterGlobalFunction("void PlotLines(const string&in label, array<float>&in values, int values_count, int values_offset = 0, const string&in overlay_text = string(), float scale_min = FLT_MAX, float scale_max = FLT_MAX, vector2 graph_size = vector2(0,0))", asFUNCTION(ImGui_PlotLines), asCALL_CDECL);
388
389 engine->SetDefaultNamespace("");
390}
391
Helper/wrapper functions shared by native (ImGuiAngelscript.cpp) and generic (ImGuiAngelscriptGeneric...
void RegisterImGuiNativeBindings(AngelScript::asIScriptEngine *engine)
static void ImDrawList_AddRectFilled(ImDrawList *drawlist, Ogre::Vector2 const &p1, Ogre::Vector2 const &p2, Ogre::ColourValue const &col, float rounding, int rounding_corners)
static void ImGui_CalcListClipping(int a, float b, int &c, int &d)
static bool ImGui_ColorEdit4(const string &id, ColourValue &val)
static bool ImGui_BeginPopupContextVoid(const string &a, int b)
static void ImGui_SetCursorScreenPos(Vector2 v)
static void ImDrawList_AddTriangleFilled(ImDrawList *drawlist, Ogre::Vector2 const &p1, Ogre::Vector2 const &p2, Ogre::Vector2 const &p3, Ogre::ColourValue const &col)
static void ImGui_CaptureKeyboardFromApp(bool a)
static void ImGui_SetNextWindowSize(Vector2 v)
static bool ImGui_InputFloat(const string &id, float &val)
static void ImDrawList_AddRect(ImDrawList *drawlist, Ogre::Vector2 const &p1, Ogre::Vector2 const &p2, Ogre::ColourValue const &col, float rounding, int rounding_corners, float thickness)
static void ImDrawList_AddImage(ImDrawList *drawlist, Ogre::TexturePtr const &tex, Ogre::Vector2 const &p_min, Ogre::Vector2 const &p_max, Ogre::Vector2 const &uv_min, Ogre::Vector2 const &uv_max, Ogre::ColourValue const &col)
static Vector2 ImGui_GetWindowContentRegionMax()
static bool ImGui_SliderFloat(const string &n, float &v, float mn, float mx)
static bool ImGui_InputFloat3(const string &id, Vector3 &val)
static void ImGui_CaptureMouseFromApp(bool a)
static float ImGui_GetColumnWidth(int a)
static bool ImGui_BeginPopup(const string &a, int b)
static Vector2 ImGui_GetMouseDragDelta(int a, float b)
static void ImGui_SetCursorPos(Vector2 v)
static void ImGui_ValueInt(const string &n, int v)
static bool ImGui_ListBoxHeader(const string &n)
static bool ImGui_MenuItemToggle(const string &a, const string &b, bool &c, bool d)
static bool ImGui_InputTextMultiline(const string &id, string &val, const Ogre::Vector2 &size)
static void ImGui_TextColored(ColourValue c, const string &n)
static void ImGui_PushStyleColor(int index, Ogre::ColourValue const &col)
static bool ImGui_BeginChildFrame(unsigned a, const Vector2 &b, int c)
static bool ImGui_TreeNode(const string &id)
static void ImGui_LabelText(const string &l, const string &n)
static bool ImGui_SliderInt(const string &n, int &v, int mn, int mx)
static void ImGui_ValueUint(const string &n, unsigned v)
static void ImDrawList_AddCircleFilled(ImDrawList *drawlist, Ogre::Vector2 const &center, float radius, Ogre::ColourValue const &col, int num_segments)
static bool ImGui_DragIntRange2(const string &n, int &v0, int &v1, int mn, int mx)
static bool ImGui_BeginTabBar(const string &str_id, ImGuiTabBarFlags flags)
static void ImDrawList_AddText(ImDrawList *drawlist, Ogre::Vector2 const &pos, Ogre::ColourValue const &col, std::string const &text)
static bool ImGui_Begin(const string &name, bool &opened, int flags)
static bool ImGui_IsMouseHoveringRect(const Vector2 &a, const Vector2 &b, bool c)
static bool ImGui_BeginTabItem(const string &label, ImGuiTabItemFlags flags)
static void ImGui_TreePush(const string &id)
static void ImGui_SetWindowCollapsed(bool v)
static void ImGui_SetNextTreeNodeOpen(bool val)
static void ImGui_PushStyleVarFloat(int index, float val)
static bool ImGui_SliderFloat2(const string &n, Vector2 &v, float mn, float mx)
static Vector2 ImGui_CalcTextSize(const string &a, bool c, float d)
static void ImGui_Columns(int a, const string &b, bool c)
static bool ImGui_CollapsingHeaderClosable(const string &n, bool &v)
static void ImGui_SetNextWindowPos(Vector2 v, int flags, Vector2 pivot)
static bool ImGui_DragFloat3(const string &n, Vector3 &v)
static void ImGui_SetColumnOffset(int a, float b)
static bool ImGui_IsMouseClicked(int a, bool b)
static void ImGui_TextWrapped(const string &n)
static void ImDrawList_AddTriangle(ImDrawList *drawlist, Ogre::Vector2 const &p1, Ogre::Vector2 const &p2, Ogre::Vector2 const &p3, Ogre::ColourValue const &col, float thickness)
static void ImGui_TextDisabled(const string &n)
static void ImGui_SetWindowSizeByName(const string &name, Vector2 v)
static bool ImGui_IsMouseDragging(int a, float b)
static unsigned ImGui_GetID(const string &n)
static bool ImGui_SliderFloat3(const string &n, Vector3 &v, float mn, float mx)
static void ImGui_PushClipRect(const Vector2 &a, const Vector2 &b, bool c)
static void ImGui_SetWindowCollapsedByName(const string &name, bool v)
static bool ImGui_InputText(const string &id, string &val)
static void ImGui_SetNextWindowContentSize(Vector2 v)
static bool ImGui_InputFloat2(const string &id, Vector2 &val)
static void ImGui_PushStyleVarVector2(int index, const Ogre::Vector2 &val)
static void ImDrawList_AddLine(ImDrawList *drawlist, Ogre::Vector2 const &p1, Ogre::Vector2 const &p2, Ogre::ColourValue const &col, float thickness)
static void ImGui_SetMouseCursor(ImGuiMouseCursor a)
static bool ImGui_DragFloat(const string &n, float &v, float speed, float mn, float mx)
static void ImGui_SetKeyboardFocusHere(int a)
static bool ImGui_ColorEdit3(const string &id, ColourValue &val)
static void ImGui_ProgressBar(float v, Ogre::Vector2 size, const string &overlay)
static void ImGui_OpenPopup(const string &a)
static bool ImGui_BeginPopupContextWindow(const string &a, int b, bool c)
static bool ImGui_RadioButton(const string &n, bool v)
static bool ImGui_MenuItem(const string &a, const string &b, bool c, bool d)
static void ImGui_SetTooltip(const string &t)
static Vector2 ImGui_GetWindowContentRegionMin()
static bool ImGui_BeginPopupContextItem(const string &a, int b)
static void ImGui_SetWindowPosByName(const string &name, Vector2 v)
static bool ImGui_BeginPopupModal(const string &a, bool &b, int c)
static void ImGui_PlotLines(const string &label, CScriptArray *values, int values_count, int values_offset, const string &overlay_text, float scale_min, float scale_max, Vector2 graph_size)
static bool ImGui_Selectable(const string &n, bool v)
static void ImGui_SetWindowFocusByName(const string &v)
static bool ImGui_BeginChild(const string &name, const Ogre::Vector2 &size, bool border, int flags)
static bool ImGui_SmallButton(const string &n)
static bool ImGui_ColorButton(const string &id, ColourValue val)
static void ImGui_PushIDStr(const string &n)
static bool ImGui_CheckboxFlags(const string &n, unsigned &f, unsigned v)
static void ImGui_SetClipboardText(const string &a)
static void ImGui_BulletText(const string &n)
static void ImGui_SetWindowSize(Vector2 v)
static void ImDrawList_AddCircle(ImDrawList *drawlist, Ogre::Vector2 const &center, float radius, Ogre::ColourValue const &col, int num_segments, float thickness)
static bool ImGui_Button(const string &n, Vector2 v)
static float ImGui_GetColumnOffset(int a)
static bool ImGui_CollapsingHeader(const string &n)
static bool ImGui_IsRectVisibleSize(const Vector2 &a)
static void ImGui_SetWindowPos(Vector2 v)
static bool ImGui_InvisibleButton(const string &id, Vector2 v)
static bool ImGui_Checkbox(const string &n, bool &v)
static bool ImGui_IsKeyPressed(int a, bool b)
static bool ImGui_DragFloatRange2(const string &n, float &v0, float &v1, float mn, float mx)
static bool ImGui_IsMouseDoubleClicked(int a)
static bool ImGui_IsRectVisible(const Vector2 &a, const Vector2 &b)
static bool ImGui_RadioButtonInt(const string &n, int &v, int vv)
static void ImGui_Image(Ogre::TexturePtr const &tex, Vector2 v)
static void ImGui_ResetMouseDragDelta(int a)
static bool ImGui_InputInt(const string &id, int &val)
static void ImGui_ValueBool(const string &n, bool v)
static void ImGui_Text(const string &n)
static Vector2 ImGui_GetMousePosOnOpeningCurrentPopup()
static void ImGui_SetNextWindowCollapsed(bool v)
static void ImGui_Dummy(Vector2 v)
static void ImGui_ValueFloat(const string &n, float v)
static bool ImGui_BeginTabItemClosable(const string &label, bool &p_open, ImGuiTabItemFlags flags)
static void ImGui_SetTabItemClosed(const string &tab_or_docked_window_label)
static bool ImGui_BeginChildById(ImGuiID id, const Ogre::Vector2 &size, bool border, int flags)
static bool ImGui_DragFloat2(const string &n, Vector2 &v)
static bool ImGui_BeginMenu(const string &a, bool b)