63 engine->SetDefaultNamespace(
"ImGui");
65 engine->RegisterGlobalFunction(
"bool Begin(const string&in, bool, int=0)",
66 asFUNCTIONPR([](
const string &name,
bool opened,
int flags)
67 {
return ImGui::Begin(name.c_str(), &opened, flags); },
68 (
const string &, bool,
int),
bool),
70 engine->RegisterGlobalFunction(
"void End()", asFUNCTIONPR(ImGui::End, (), void), asCALL_CDECL);
71 engine->RegisterGlobalFunction(
72 "bool BeginChild(const string&in)",
73 asFUNCTIONPR([](
const string &name) {
return ImGui::Begin(name.c_str()); }, (
const string &),
bool), asCALL_CDECL);
74 engine->RegisterGlobalFunction(
"void EndChild()", asFUNCTIONPR(ImGui::EndChild, (), void), asCALL_CDECL);
76 engine->RegisterGlobalFunction(
"ImVec2 GetContentRegionMax()",
80 auto v = ImGui::GetContentRegionMax();
81 return ImVec2(v.x, v.y);
85 engine->RegisterGlobalFunction(
"ImVec2 GetContentRegionAvail()",
89 auto v = ImGui::GetContentRegionAvail();
90 return ImVec2(v.x, v.y);
95 engine->RegisterGlobalFunction(
"ImVec2 GetWindowContentRegionMin()",
99 auto v = ImGui::GetWindowContentRegionMin();
100 return ImVec2(v.x, v.y);
104 engine->RegisterGlobalFunction(
"ImVec2 GetWindowContentRegionMax()",
108 auto v = ImGui::GetWindowContentRegionMax();
109 return ImVec2(v.x, v.y);
113 engine->RegisterGlobalFunction(
"float GetWindowRegionWidth()", asFUNCTIONPR(ImGui::GetWindowContentRegionWidth, (), float),
116 engine->RegisterGlobalFunction(
"ImVec2 GetWindowPos()",
120 auto v = ImGui::GetWindowPos();
121 return ImVec2(v.x, v.y);
125 engine->RegisterGlobalFunction(
"ImVec2 GetWindowSize()",
129 auto v = ImGui::GetWindowSize();
130 return ImVec2(v.x, v.y);
134 engine->RegisterGlobalFunction(
"float GetWindowWedth()", asFUNCTIONPR(ImGui::GetWindowWidth, (), float), asCALL_CDECL);
135 engine->RegisterGlobalFunction(
"float GetWindowHeight()", asFUNCTIONPR(ImGui::GetWindowHeight, (), float), asCALL_CDECL);
136 engine->RegisterGlobalFunction(
"bool IsWindowCollapsed()", asFUNCTIONPR(ImGui::IsWindowCollapsed, (), bool), asCALL_CDECL);
138 engine->RegisterGlobalFunction(
"void SetWindowFontScale(float)", asFUNCTIONPR(ImGui::SetWindowFontScale, (
float), void),
141 engine->RegisterGlobalFunction(
"void SetNextWindowPos(ImVec2)",
142 asFUNCTIONPR([](ImVec2 v) { ImGui::SetNextWindowPos(ImVec2(v.x, v.y)); }, (ImVec2),
void),
144 engine->RegisterGlobalFunction(
"void SetNextWindowSize(ImVec2)",
145 asFUNCTIONPR([](ImVec2 v) { ImGui::SetNextWindowSize(ImVec2(v.x, v.y)); }, (ImVec2),
void),
147 engine->RegisterGlobalFunction(
148 "void SetNextWindowContentSize(ImVec2)",
149 asFUNCTIONPR([](ImVec2 v) { ImGui::SetNextWindowContentSize(ImVec2(v.x, v.y)); }, (ImVec2),
void), asCALL_CDECL);
150 engine->RegisterGlobalFunction(
"void SetNextWindowCollapsed(bool)",
151 asFUNCTIONPR([](
bool v) { ImGui::SetNextWindowCollapsed(v); }, (bool),
void), asCALL_CDECL);
152 engine->RegisterGlobalFunction(
"void SetNextWindowFocus()", asFUNCTIONPR([]() { ImGui::SetNextWindowFocus(); }, (),
void),
154 engine->RegisterGlobalFunction(
"void SetWindowPos(ImVec2)",
155 asFUNCTIONPR([](ImVec2 v) { ImGui::SetWindowPos(ImVec2(v.x, v.y)); }, (ImVec2),
void),
157 engine->RegisterGlobalFunction(
"void SetWindowSize(ImVec2)",
158 asFUNCTIONPR([](ImVec2 v) { ImGui::SetWindowSize(ImVec2(v.x, v.y)); }, (ImVec2),
void),
160 engine->RegisterGlobalFunction(
"void SetWindowCollapsed(bool)",
161 asFUNCTIONPR([](
bool v) { ImGui::SetWindowCollapsed(v); }, (bool),
void), asCALL_CDECL);
162 engine->RegisterGlobalFunction(
"void SetWindowFocus()", asFUNCTIONPR([]() { ImGui::SetWindowFocus(); }, (),
void),
165 engine->RegisterGlobalFunction(
"void SetWindowPos(const string&in, ImVec2)",
166 asFUNCTIONPR([](
const string &name, ImVec2 v)
167 { ImGui::SetWindowPos(name.c_str(), ImVec2(v.x, v.y)); },
168 (
const string &, ImVec2),
void),
170 engine->RegisterGlobalFunction(
"void SetWindowSize(const string&in, ImVec2)",
171 asFUNCTIONPR([](
const string &name, ImVec2 v)
172 { ImGui::SetWindowSize(name.c_str(), ImVec2(v.x, v.y)); },
173 (
const string &, ImVec2),
void),
175 engine->RegisterGlobalFunction(
176 "void SetWindowCollapsed(const string&in, bool)",
177 asFUNCTIONPR([](
const string &name,
bool v) { ImGui::SetWindowCollapsed(name.c_str(), v); }, (
const string &, bool),
void),
179 engine->RegisterGlobalFunction(
"void SetWindowFocus(const string&in)",
180 asFUNCTIONPR([](
const string &v) { ImGui::SetWindowFocus(v.c_str()); }, (
const string &),
void),
183 engine->RegisterGlobalFunction(
"float GetScrollX()", asFUNCTIONPR(ImGui::GetScrollX, (), float), asCALL_CDECL);
184 engine->RegisterGlobalFunction(
"float GetScrollY()", asFUNCTIONPR(ImGui::GetScrollY, (), float), asCALL_CDECL);
185 engine->RegisterGlobalFunction(
"float GetScrollMaxX()", asFUNCTIONPR(ImGui::GetScrollMaxX, (), float), asCALL_CDECL);
186 engine->RegisterGlobalFunction(
"float GetScrollMaxY()", asFUNCTIONPR(ImGui::GetScrollMaxY, (), float), asCALL_CDECL);
187 engine->RegisterGlobalFunction(
"void SetScrollX(float)", asFUNCTIONPR(ImGui::SetScrollX, (
float), void), asCALL_CDECL);
188 engine->RegisterGlobalFunction(
"void SetScrollY(float)", asFUNCTIONPR(ImGui::SetScrollY, (
float), void), asCALL_CDECL);
190 engine->RegisterGlobalFunction(
"void SetScrollFromPosY(float, float = 0.5f)",
191 asFUNCTIONPR(ImGui::SetScrollFromPosY, (
float,
float), void), asCALL_CDECL);
193 engine->RegisterGlobalFunction(
"void Separator()", asFUNCTIONPR(ImGui::Separator, (), void), asCALL_CDECL);
194 engine->RegisterGlobalFunction(
"void SameLine(float = 0.0f, float = -1.0f)",
195 asFUNCTIONPR(ImGui::SameLine, (
float,
float), void), asCALL_CDECL);
196 engine->RegisterGlobalFunction(
"void NewLine()", asFUNCTIONPR(ImGui::NewLine, (), void), asCALL_CDECL);
197 engine->RegisterGlobalFunction(
"void Spacing()", asFUNCTIONPR(ImGui::Spacing, (), void), asCALL_CDECL);
198 engine->RegisterGlobalFunction(
"void Dummy(ImVec2)",
199 asFUNCTIONPR([](ImVec2 v) { ImGui::Dummy(ImVec2(v.x, v.y)); }, (ImVec2),
void), asCALL_CDECL);
200 engine->RegisterGlobalFunction(
"void Indent(float = 0.0f)", asFUNCTIONPR(ImGui::Indent, (
float), void), asCALL_CDECL);
201 engine->RegisterGlobalFunction(
"void Unindent(float = 0.0f)", asFUNCTIONPR(ImGui::Unindent, (
float), void), asCALL_CDECL);
202 engine->RegisterGlobalFunction(
"void BeginGroup()", asFUNCTIONPR(ImGui::BeginGroup, (), void), asCALL_CDECL);
203 engine->RegisterGlobalFunction(
"void EndGroup()", asFUNCTIONPR(ImGui::EndGroup, (), void), asCALL_CDECL);
204 engine->RegisterGlobalFunction(
"ImVec2 GetCursorPos()",
208 auto v = ImGui::GetCursorPos();
209 return ImVec2(v.x, v.y);
213 engine->RegisterGlobalFunction(
"float GetCursorPosX()", asFUNCTIONPR(ImGui::GetCursorPosX, (), float), asCALL_CDECL);
214 engine->RegisterGlobalFunction(
"float GetCursorPosY()", asFUNCTIONPR(ImGui::GetCursorPosY, (), float), asCALL_CDECL);
215 engine->RegisterGlobalFunction(
"void SetCursorPos(ImVec2)",
216 asFUNCTIONPR([](ImVec2 v) { ImGui::SetCursorPos(ImVec2(v.x, v.y)); }, (ImVec2),
void),
218 engine->RegisterGlobalFunction(
"void SetCursorPosX(float)", asFUNCTIONPR(ImGui::SetCursorPosX, (
float), void), asCALL_CDECL);
219 engine->RegisterGlobalFunction(
"void SetCursorPosY(float)", asFUNCTIONPR(ImGui::SetCursorPosY, (
float), void), asCALL_CDECL);
220 engine->RegisterGlobalFunction(
"ImVec2 GetCursorStartPos()",
224 auto v = ImGui::GetCursorStartPos();
225 return ImVec2(v.x, v.y);
229 engine->RegisterGlobalFunction(
"ImVec2 GetCursorScreenPos()",
233 auto v = ImGui::GetCursorScreenPos();
234 return ImVec2(v.x, v.y);
238 engine->RegisterGlobalFunction(
"void SetCursorScreenPos(ImVec2)",
239 asFUNCTIONPR([](ImVec2 v) { ImGui::SetCursorScreenPos(ImVec2(v.x, v.y)); }, (ImVec2),
void),
242 engine->RegisterGlobalFunction(
"float GetTextLineHeight()", asFUNCTIONPR(ImGui::GetTextLineHeight, (), float), asCALL_CDECL);
243 engine->RegisterGlobalFunction(
"float GetTextLineHeightWithSpacing()",
244 asFUNCTIONPR(ImGui::GetTextLineHeightWithSpacing, (), float), asCALL_CDECL);
249 engine->RegisterGlobalFunction(
"void Columns(int = 1, const string&in = string(), bool = true)",
250 asFUNCTIONPR([](
int a,
const string &b,
bool c)
251 { ImGui::Columns(a, b.empty() ? b.c_str() : 0x0, c); },
252 (
int,
const string &, bool),
void),
254 engine->RegisterGlobalFunction(
"void NextColumn()", asFUNCTIONPR([]() { ImGui::NextColumn(); }, (),
void), asCALL_CDECL);
255 engine->RegisterGlobalFunction(
"int GetColumnIndex()", asFUNCTIONPR([]() {
return ImGui::GetColumnIndex(); }, (),
int),
257 engine->RegisterGlobalFunction(
"float GetColumnWidth(int = -1)",
258 asFUNCTIONPR([](
int a) {
return ImGui::GetColumnWidth(a); }, (
int),
float), asCALL_CDECL);
260 engine->RegisterGlobalFunction(
"float GetColumnOffset(int = -1)",
261 asFUNCTIONPR([](
int a) {
return ImGui::GetColumnOffset(a); }, (
int),
float), asCALL_CDECL);
262 engine->RegisterGlobalFunction(
"void SetColumnOffset(int, float)",
263 asFUNCTIONPR([](
int a,
float b) { ImGui::SetColumnOffset(a, b); }, (
int, float),
void),
265 engine->RegisterGlobalFunction(
"int GetColumnsCount()", asFUNCTIONPR([]() {
return ImGui::GetColumnsCount(); }, (),
int),
269 engine->RegisterGlobalFunction(
"void PushID(const string&in)",
270 asFUNCTIONPR([](
const string &n) { ImGui::PushID(n.c_str()); }, (
const string &),
void),
272 engine->RegisterGlobalFunction(
"void PushID(int int_id)", asFUNCTIONPR([](
int id) { ImGui::PushID(
id); }, (
int),
void),
274 engine->RegisterGlobalFunction(
"void PopID()", asFUNCTIONPR(ImGui::PopID, (), void), asCALL_CDECL);
275 engine->RegisterGlobalFunction(
276 "uint GetID(const string&in)",
277 asFUNCTIONPR([](
const string &n) {
return ImGui::GetID(n.c_str()); }, (
const string &),
unsigned), asCALL_CDECL);
280 engine->RegisterGlobalFunction(
"void Text(const string&in)",
281 asFUNCTIONPR([](
const string &n) { ImGui::Text(n.c_str()); }, (
const string &),
void),
283 engine->RegisterGlobalFunction(
"void TextDisabled(const string&in)",
284 asFUNCTIONPR([](
const string &n) { ImGui::TextDisabled(n.c_str()); }, (
const string &),
void),
291 engine->RegisterGlobalFunction(
"void TextWrapped(const string&in)",
292 asFUNCTIONPR([](
const string &n) { ImGui::TextWrapped(n.c_str()); }, (
const string &),
void),
294 engine->RegisterGlobalFunction(
"void LabelText(const string&in, const string&in)",
295 asFUNCTIONPR([](
const string &l,
const string &n) { ImGui::LabelText(l.c_str(), n.c_str()); },
296 (
const string &,
const string &),
void),
298 engine->RegisterGlobalFunction(
"void Bullet()", asFUNCTIONPR(ImGui::Bullet, (), void), asCALL_CDECL);
299 engine->RegisterGlobalFunction(
"void BulletText(const string&in)",
300 asFUNCTIONPR([](
const string &n) { ImGui::BulletText(n.c_str()); }, (
const string &),
void),
304 engine->RegisterGlobalFunction(
"bool Button(const string&in, ImVec2 = ImVec2(0,0))",
305 asFUNCTIONPR([](
const string &n, ImVec2 v)
306 {
return ImGui::Button(n.c_str(), ImVec2(v.x, v.y)); },
307 (
const string &, ImVec2),
bool),
309 engine->RegisterGlobalFunction(
310 "bool SmallButton(const string&in)",
311 asFUNCTIONPR([](
const string &n) {
return ImGui::SmallButton(n.c_str()); }, (
const string &),
bool), asCALL_CDECL);
312 engine->RegisterGlobalFunction(
"bool InvisibleButton(const string&in, ImVec2)",
313 asFUNCTIONPR([](
const string &
id, ImVec2 v)
314 {
return ImGui::InvisibleButton(
id.c_str(), ImVec2(v.x, v.y)); },
315 (
const string &, ImVec2),
bool),
322 engine->RegisterGlobalFunction(
323 "bool Checkbox(const string&in, bool&inout)",
324 asFUNCTIONPR([](
const string &n,
bool &v) {
return ImGui::Checkbox(n.c_str(), &v); }, (
const string &,
bool &),
bool),
326 engine->RegisterGlobalFunction(
"bool CheckboxFlags(const string&in, uint&inout, uint)",
327 asFUNCTIONPR([](
const string &n,
unsigned &f,
unsigned v)
328 {
return ImGui::CheckboxFlags(n.c_str(), &f, v); },
329 (
const string &,
unsigned &, unsigned),
bool),
331 engine->RegisterGlobalFunction(
332 "bool RadioButton(const string&in, bool)",
333 asFUNCTIONPR([](
const string &n,
bool v) {
return ImGui::RadioButton(n.c_str(), v); }, (
const string &, bool),
bool),
335 engine->RegisterGlobalFunction(
"bool RadioButton(const string&in, int&inout, int)",
336 asFUNCTIONPR([](
const string &n,
int &v,
int vv)
337 {
return ImGui::RadioButton(n.c_str(), &v, vv); },
338 (
const string &,
int &,
int),
bool),
340 engine->RegisterGlobalFunction(
"void ProgressBar(float)", asFUNCTIONPR([](
float v) { ImGui::ProgressBar(v); }, (float),
void),
361 engine->RegisterGlobalFunction(
"bool DragFloat(const string&in, float&inout, float = 1.0f, float = 0.0f, float = 0.0f)",
362 asFUNCTIONPR([](
const string &n,
float &v,
float speed,
float mn,
float mx)
363 {
return ImGui::DragFloat(n.c_str(), &v, speed, mn, mx); },
364 (
const string &,
float &, float, float, float),
bool),
366 engine->RegisterGlobalFunction(
"bool DragFloat2(const string&in, ImVec2&inout)",
367 asFUNCTIONPR([](
const string &n, ImVec2 &v) {
return ImGui::DragFloat2(n.c_str(), &v.x); },
368 (
const string &, ImVec2 &),
bool),
382 engine->RegisterGlobalFunction(
"bool DragFloatRange2(const string&in, float&inout, float&inout, float = 0.0f, float = 1.0f)",
383 asFUNCTIONPR([](
const string &n,
float &v0,
float &v1,
float mn,
float mx)
384 {
return ImGui::DragFloatRange2(n.c_str(), &v0, &v1, 1.0f, mn, mx); },
385 (
const string &,
float &,
float &, float, float),
bool),
387 engine->RegisterGlobalFunction(
"bool DragIntRange2(const string&in, int&inout, int&inout, int, int)",
388 asFUNCTIONPR([](
const string &n,
int &v0,
int &v1,
int mn,
int mx)
389 {
return ImGui::DragIntRange2(n.c_str(), &v0, &v1, 1.0f, mn, mx); },
390 (
const string &,
int &,
int &,
int,
int),
bool),
394 static char imgui_text_buffer[4096];
395 engine->RegisterGlobalFunction(
"bool InputText(const string&in, string&inout)",
397 [](
const string &
id,
string &val)
399 memset(imgui_text_buffer, 0,
sizeof(
char) * 4096);
400 strcpy(imgui_text_buffer, val.c_str());
401 if (ImGui::InputText(
id.c_str(), imgui_text_buffer, 4096))
403 val = imgui_text_buffer;
408 (
const string &,
string &),
bool),
410 engine->RegisterGlobalFunction(
"bool InputTextMultiline(const string&in, string&inout)",
412 [](
const string &
id,
string &val)
414 memset(imgui_text_buffer, 0,
sizeof(
char) * 4096);
415 strcpy(imgui_text_buffer, val.c_str());
416 if (ImGui::InputTextMultiline(
id.c_str(), imgui_text_buffer, 4096))
418 val = imgui_text_buffer;
423 (
const string &,
string &),
bool),
425 engine->RegisterGlobalFunction(
"bool InputFloat(const string&, float&inout)",
426 asFUNCTIONPR([](
const string &
id,
float &val) {
return ImGui::InputFloat(
id.c_str(), &val); },
427 (
const string &,
float &),
bool),
429 engine->RegisterGlobalFunction(
"bool InputFloat2(const string&, ImVec2&inout)",
430 asFUNCTIONPR([](
const string &
id, ImVec2 &val)
431 {
return ImGui::InputFloat2(
id.c_str(), &val.x); },
432 (
const string &, ImVec2 &),
bool),
451 engine->RegisterGlobalFunction(
"bool SliderFloat(const string&in, float&inout, float = 0.0f, float = 0.0f)",
452 asFUNCTIONPR([](
const string &n,
float &v,
float mn,
float mx)
453 {
return ImGui::SliderFloat(n.c_str(), &v, mn, mx); },
454 (
const string &,
float &, float, float),
bool),
456 engine->RegisterGlobalFunction(
"bool SliderFloat2(const string&in, ImVec2&inout, float, float)",
457 asFUNCTIONPR([](
const string &n, ImVec2 &v,
float mn,
float mx)
458 {
return ImGui::SliderFloat2(n.c_str(), &v.x, mn, mx); },
459 (
const string &, ImVec2 &, float, float),
bool),
536 engine->RegisterGlobalFunction(
537 "bool TreeNode(const string&in)",
538 asFUNCTIONPR([](
const string &
id) {
return ImGui::TreeNode(
id.c_str()); }, (
const string &),
bool), asCALL_CDECL);
539 engine->RegisterGlobalFunction(
"void TreePush(const string&in)",
540 asFUNCTIONPR([](
const string &
id) { ImGui::TreePush(
id.c_str()); }, (
const string &),
void),
542 engine->RegisterGlobalFunction(
"void TreePop()", asFUNCTIONPR(ImGui::TreePop, (), void), asCALL_CDECL);
545 engine->RegisterGlobalFunction(
"float GetTreeNodeToLabelSpacing()", asFUNCTIONPR(ImGui::GetTreeNodeToLabelSpacing, (), float),
549 engine->RegisterGlobalFunction(
550 "bool CollapsingHeader(const string&in)",
551 asFUNCTIONPR([](
const string &n) {
return ImGui::CollapsingHeader(n.c_str()); }, (
const string &),
bool), asCALL_CDECL);
552 engine->RegisterGlobalFunction(
"bool CollapsingHeader(const string&in, bool&inout)",
553 asFUNCTIONPR([](
const string &n,
bool &v) {
return ImGui::CollapsingHeader(n.c_str(), &v); },
554 (
const string &,
bool &),
bool),
558 engine->RegisterGlobalFunction(
559 "bool Selectable(const string&in, bool = false)",
560 asFUNCTIONPR([](
const string &n,
bool v) {
return ImGui::Selectable(n.c_str(), v); }, (
const string &, bool),
bool),
562 engine->RegisterGlobalFunction(
563 "bool ListBoxHeader(const string&in)",
564 asFUNCTIONPR([](
const string &n) {
return ImGui::ListBoxHeader(n.c_str()); }, (
const string &),
bool), asCALL_CDECL);
567 engine->RegisterGlobalFunction(
568 "void Value(const string&in, bool)",
569 asFUNCTIONPR([](
const string &n,
bool v) { ImGui::Value(n.c_str(), v); }, (
const string &, bool),
void), asCALL_CDECL);
570 engine->RegisterGlobalFunction(
571 "void Value(const string&in, int)",
572 asFUNCTIONPR([](
const string &n,
int v) { ImGui::Value(n.c_str(), v); }, (
const string &,
int),
void), asCALL_CDECL);
573 engine->RegisterGlobalFunction(
574 "void Value(const string&in, uint)",
575 asFUNCTIONPR([](
const string &n,
unsigned v) { ImGui::Value(n.c_str(), v); }, (
const string &, unsigned),
void),
577 engine->RegisterGlobalFunction(
578 "void Value(const string&in, float)",
579 asFUNCTIONPR([](
const string &n,
float v) { ImGui::Value(n.c_str(), v); }, (
const string &, float),
void), asCALL_CDECL);
582 engine->RegisterGlobalFunction(
"void BeginTooltip()", asFUNCTIONPR(ImGui::BeginTooltip, (), void), asCALL_CDECL);
583 engine->RegisterGlobalFunction(
"void EndTooltip()", asFUNCTIONPR(ImGui::EndTooltip, (), void), asCALL_CDECL);
584 engine->RegisterGlobalFunction(
"void SetTooltip(const string&in)",
585 asFUNCTIONPR([](
const string &t) { ImGui::SetTooltip(t.c_str()); }, (
const string &),
void),
589 engine->RegisterGlobalFunction(
"bool BeginMainMenuBar()", asFUNCTIONPR([]() {
return ImGui::BeginMainMenuBar(); }, (),
bool),
591 engine->RegisterGlobalFunction(
"void EndMainMenuBar()", asFUNCTIONPR([]() { ImGui::EndMainMenuBar(); }, (),
void),
593 engine->RegisterGlobalFunction(
"bool BeginMenuBar()", asFUNCTIONPR([]() {
return ImGui::BeginMenuBar(); }, (),
bool),
595 engine->RegisterGlobalFunction(
"void EndMenuBar()", asFUNCTIONPR([]() { ImGui::EndMenuBar(); }, (),
void), asCALL_CDECL);
596 engine->RegisterGlobalFunction(
"bool BeginMenu(const string&in, bool = true)",
597 asFUNCTIONPR([](
const string &a,
bool b)
598 {
return ImGui::BeginMenu(a.empty() ? a.c_str() : 0x0, b); },
599 (
const string &, bool),
bool),
601 engine->RegisterGlobalFunction(
"void EndMenu()", asFUNCTIONPR([]() { ImGui::EndMenu(); }, (),
void), asCALL_CDECL);
602 engine->RegisterGlobalFunction(
603 "bool MenuItem(const string&in, const string&in = string(), bool = false, bool = true)",
604 asFUNCTIONPR([](
const string &a,
const string &b,
bool c,
bool d)
605 {
return ImGui::MenuItem(a.empty() ? a.c_str() : 0x0, b.empty() ? b.c_str() : 0x0, c, d); },
606 (
const string &,
const string &, bool, bool),
bool),
608 engine->RegisterGlobalFunction(
609 "bool MenuItem(const string&in, const string&in, bool &inout, bool = true)",
610 asFUNCTIONPR([](
const string &a,
const string &b,
bool &c,
bool d)
611 {
return ImGui::MenuItem(a.empty() ? a.c_str() : 0x0, b.empty() ? b.c_str() : 0x0, &c, d); },
612 (
const string &,
const string &,
bool &, bool),
bool),
616 engine->RegisterGlobalFunction(
617 "void OpenPopup(const string&in)",
618 asFUNCTIONPR([](
const string &a) { ImGui::OpenPopup(a.empty() ? a.c_str() : 0x0); }, (
const string &),
void), asCALL_CDECL);
621 engine->RegisterGlobalFunction(
"bool BeginPopup(const string&in, int = 0)",
622 asFUNCTIONPR([](
const string &a,
int b)
623 {
return ImGui::BeginPopup(a.empty() ? a.c_str() : 0x0); },
624 (
const string &,
int),
bool),
626 engine->RegisterGlobalFunction(
"bool BeginPopupContextItem(const string&in = string(), int = 1)",
627 asFUNCTIONPR([](
const string &a,
int b)
628 {
return ImGui::BeginPopupContextItem(a.empty() ? a.c_str() : 0x0, b); },
629 (
const string &,
int),
bool),
631 engine->RegisterGlobalFunction(
"bool BeginPopupContextWindow(const string&in = string(), int = 1, bool = true)",
632 asFUNCTIONPR([](
const string &a,
int b,
bool c)
633 {
return ImGui::BeginPopupContextWindow(a.empty() ? a.c_str() : 0x0, b, c); },
634 (
const string &,
int, bool),
bool),
636 engine->RegisterGlobalFunction(
"bool BeginPopupContextVoid(const string&in = string(), int = 1)",
637 asFUNCTIONPR([](
const string &a,
int b)
638 {
return ImGui::BeginPopupContextVoid(a.empty() ? a.c_str() : 0x0, b); },
639 (
const string &,
int),
bool),
641 engine->RegisterGlobalFunction(
642 "bool BeginPopupModal(const string&in, bool &inout = null, int = 0)",
643 asFUNCTIONPR([](
const string &a,
bool &b,
int c)
644 {
return ImGui::BeginPopupModal(a.empty() ? a.c_str() : 0x0, &b, (ImGuiWindowFlags)c); },
645 (
const string &,
bool &,
int),
bool),
647 engine->RegisterGlobalFunction(
"void EndPopup()", asFUNCTIONPR([]() { ImGui::EndPopup(); }, (),
void), asCALL_CDECL);
652 engine->RegisterGlobalFunction(
"void CloseCurrentPopup()", asFUNCTIONPR([]() { ImGui::CloseCurrentPopup(); }, (),
void),
656 engine->RegisterGlobalFunction(
"void PushClipRect(const ImVec2&, const ImVec2&, bool)",
657 asFUNCTIONPR([](
const ImVec2 &a,
const ImVec2 &b,
bool c)
658 { ImGui::PushClipRect(ImVec2(a.x, a.y), ImVec2(b.x, b.y), c); },
659 (
const ImVec2 &,
const ImVec2 &, bool),
void),
661 engine->RegisterGlobalFunction(
"void PopClipRect()", asFUNCTIONPR([]() { ImGui::PopClipRect(); }, (),
void), asCALL_CDECL);
665 engine->RegisterGlobalFunction(
"void SetKeyboardFocusHere(int = 0)",
666 asFUNCTIONPR([](
int a) { ImGui::SetKeyboardFocusHere(a); }, (
int),
void), asCALL_CDECL);
669 engine->RegisterGlobalFunction(
"bool IsItemHovered(int = 0)",
670 asFUNCTIONPR([](
int a) {
return ImGui::IsItemHovered(); }, (
int),
bool),
672 engine->RegisterGlobalFunction(
"bool IsItemActive()", asFUNCTIONPR([]() {
return ImGui::IsItemActive(); }, (),
bool),
674 engine->RegisterGlobalFunction(
"bool IsItemClicked(int = 0)",
675 asFUNCTIONPR([](
int a) {
return ImGui::IsItemClicked(a); }, (
int),
bool), asCALL_CDECL);
676 engine->RegisterGlobalFunction(
"bool IsItemVisible()", asFUNCTIONPR([]() {
return ImGui::IsItemVisible(); }, (),
bool),
678 engine->RegisterGlobalFunction(
"bool IsAnyItemHovered()", asFUNCTIONPR([]() {
return ImGui::IsAnyItemHovered(); }, (),
bool),
680 engine->RegisterGlobalFunction(
"bool IsAnyItemActive()", asFUNCTIONPR([]() {
return ImGui::IsAnyItemActive(); }, (),
bool),
682 engine->RegisterGlobalFunction(
"ImVec2 GetItemRectMin()",
686 auto v = ImGui::GetItemRectMin();
687 return ImVec2(v.x, v.y);
691 engine->RegisterGlobalFunction(
"ImVec2 GetItemRectMax()",
695 auto v = ImGui::GetItemRectMax();
696 return ImVec2(v.x, v.y);
700 engine->RegisterGlobalFunction(
"ImVec2 GetItemRectSize()",
704 auto v = ImGui::GetItemRectSize();
705 return ImVec2(v.x, v.y);
709 engine->RegisterGlobalFunction(
"void SetItemAllowOverlap()", asFUNCTIONPR([]() { ImGui::SetItemAllowOverlap(); }, (),
void),
711 engine->RegisterGlobalFunction(
"bool IsWindowFocused(int = 0)",
712 asFUNCTIONPR([](
int a) {
return ImGui::IsWindowFocused(); }, (
int),
bool),
714 engine->RegisterGlobalFunction(
"bool IsWindowHovered(int = 0)",
715 asFUNCTIONPR([](
int a) {
return ImGui::IsWindowHovered(); }, (
int),
bool),
717 engine->RegisterGlobalFunction(
718 "bool IsRectVisible(const ImVec2&)",
719 asFUNCTIONPR([](
const ImVec2 &a) {
return ImGui::IsRectVisible(ImVec2(a.x, a.y)); }, (
const ImVec2 &),
bool), asCALL_CDECL);
720 engine->RegisterGlobalFunction(
"bool IsRectVisible(const ImVec2&, const ImVec2&)",
721 asFUNCTIONPR([](
const ImVec2 &a,
const ImVec2 &b)
722 {
return ImGui::IsRectVisible(ImVec2(a.x, a.y), ImVec2(b.x, b.y)); },
723 (
const ImVec2 &,
const ImVec2 &),
bool),
725 engine->RegisterGlobalFunction(
"float GetTime()", asFUNCTIONPR([]() {
return (
float)ImGui::GetTime(); }, (),
float),
727 engine->RegisterGlobalFunction(
"int GetFrameCount()", asFUNCTIONPR([]() {
return ImGui::GetFrameCount(); }, (),
int),
730 engine->RegisterGlobalFunction(
"ImVec2 CalcTextSize(const string&in, const string&in = string(), bool = false, float = -1.0f)",
732 [](
const string &a,
const string &b,
bool c,
float d)
735 ImGui::CalcTextSize(a.empty() ? a.c_str() : 0x0, b.empty() ? b.c_str() : 0x0, c, d);
736 return ImVec2(v.x, v.y);
738 (
const string &,
const string &, bool, float), ImVec2),
740 engine->RegisterGlobalFunction(
"void CalcListClipping(int, float, int&inout, int&inout)",
741 asFUNCTIONPR([](
int a,
float b,
int &c,
int &d) { ImGui::CalcListClipping(a, b, &c, &d); },
742 (
int, float,
int &,
int &),
void),
744 engine->RegisterGlobalFunction(
"bool BeginChildFrame(uint, const ImVec2&, int = 0)",
745 asFUNCTIONPR([](
unsigned a,
const ImVec2 &b,
int c)
746 {
return ImGui::BeginChildFrame(a, ImVec2(b.x, b.y), (ImGuiWindowFlags)c); },
747 (unsigned,
const ImVec2 &,
int),
bool),
749 engine->RegisterGlobalFunction(
"void EndChildFrame()", asFUNCTIONPR([]() { ImGui::EndChildFrame(); }, (),
void), asCALL_CDECL);
751 engine->RegisterGlobalFunction(
"int GetKeyIndex(int)",
752 asFUNCTIONPR([](
int a) {
return ImGui::GetKeyIndex((ImGuiKey)a); }, (
int),
int), asCALL_CDECL);
753 engine->RegisterGlobalFunction(
"bool IsKeyDown(int)", asFUNCTIONPR([](
int a) {
return ImGui::IsKeyDown(a); }, (
int),
bool),
755 engine->RegisterGlobalFunction(
"bool IsKeyPressed(int, bool = true)",
756 asFUNCTIONPR([](
int a,
bool b) {
return ImGui::IsKeyPressed(a, b); }, (
int, bool),
bool),
758 engine->RegisterGlobalFunction(
"bool IsKeyReleased(int)",
759 asFUNCTIONPR([](
int a) {
return ImGui::IsKeyReleased(a); }, (
int),
bool), asCALL_CDECL);
761 engine->RegisterGlobalFunction(
"bool IsMouseDown(int)", asFUNCTIONPR([](
int a) {
return ImGui::IsMouseDown(a); }, (
int),
bool),
763 engine->RegisterGlobalFunction(
"bool IsMouseClicked(int, bool = false)",
764 asFUNCTIONPR([](
int a,
bool b) {
return ImGui::IsMouseClicked(a, b); }, (
int, bool),
bool),
766 engine->RegisterGlobalFunction(
"bool IsMouseDoubleClicked(int)",
767 asFUNCTIONPR([](
int a) {
return ImGui::IsMouseDoubleClicked(a); }, (
int),
bool), asCALL_CDECL);
768 engine->RegisterGlobalFunction(
"bool IsMouseReleased(int)",
769 asFUNCTIONPR([](
int a) {
return ImGui::IsMouseReleased(a); }, (
int),
bool), asCALL_CDECL);
770 engine->RegisterGlobalFunction(
"bool IsMouseDragging(int = 0, float = -1.0f)",
771 asFUNCTIONPR([](
int a,
float b) {
return ImGui::IsMouseDragging(a, b); }, (
int, float),
bool),
773 engine->RegisterGlobalFunction(
"bool IsMouseHoveringRect(const ImVec2&in, const ImVec2&in, bool = true)",
774 asFUNCTIONPR([](
const ImVec2 &a,
const ImVec2 &b,
bool c)
775 {
return ImGui::IsMouseHoveringRect(ImVec2(a.x, a.y), ImVec2(b.x, b.y), c); },
776 (
const ImVec2 &,
const ImVec2 &, bool),
bool),
779 engine->RegisterGlobalFunction(
"ImVec2 GetMousePos()",
783 auto v = ImGui::GetMousePos();
784 return ImVec2(v.x, v.y);
788 engine->RegisterGlobalFunction(
"ImVec2 GetMousePosOnOpeningCurrentPopup()",
792 auto v = ImGui::GetMousePosOnOpeningCurrentPopup();
793 return ImVec2(v.x, v.y);
797 engine->RegisterGlobalFunction(
"ImVec2 GetMouseDragDelta(int = 0, float = -1.0f)",
801 auto v = ImGui::GetMouseDragDelta(a, b);
802 return ImVec2(v.x, v.y);
804 (
int, float), ImVec2),
806 engine->RegisterGlobalFunction(
"void ResetMouseDragDelta(int = 0)",
807 asFUNCTIONPR([](
int a) { ImGui::ResetMouseDragDelta(a); }, (
int),
void), asCALL_CDECL);
808 engine->RegisterGlobalFunction(
"int GetMouseCursor()", asFUNCTIONPR([]() {
return ImGui::GetMouseCursor(); }, (),
int),
810 engine->RegisterGlobalFunction(
"void SetMouseCursor(int)",
811 asFUNCTIONPR([](ImGuiMouseCursor a) { ImGui::SetMouseCursor(a); }, (
int),
void), asCALL_CDECL);
812 engine->RegisterGlobalFunction(
"void CaptureKeyboardFromApp(bool = true)",
813 asFUNCTIONPR([](
bool a) { ImGui::CaptureKeyboardFromApp(a); }, (bool),
void), asCALL_CDECL);
814 engine->RegisterGlobalFunction(
"void CaptureMouseFromApp(bool = true)",
815 asFUNCTIONPR([](
bool a) { ImGui::CaptureMouseFromApp(a); }, (bool),
void), asCALL_CDECL);
817 engine->RegisterGlobalFunction(
"string GetClipboardText()",
818 asFUNCTIONPR([]() {
return string(ImGui::GetClipboardText()); }, (),
string), asCALL_CDECL);
819 engine->RegisterGlobalFunction(
820 "void SetClipboardText(const string&in)",
821 asFUNCTIONPR([](
const string &a) { ImGui::SetClipboardText(a.empty() ? a.c_str() : 0x0); }, (
const string &),
void),
824 engine->SetDefaultNamespace(
"");