Register Dear ImGui functions to be accessible to an angelscript context
| 4835 | |
| 4836 | // Register Dear ImGui functions to be accessible to an angelscript context |
| 4837 | void AttachIMGUI(ASContext* context) { |
| 4838 | // TextureLoadFlags - This is a phoenix engine thing, not a Dear ImGui thing, but is necessary in order to feed images to Dear ImGui |
| 4839 | context->RegisterEnum("TextureLoadFlags"); |
| 4840 | context->RegisterEnumValue("TextureLoadFlags", "TextureLoadFlags_SRGB", PX_SRGB); |
| 4841 | context->RegisterEnumValue("TextureLoadFlags", "TextureLoadFlags_NoMipmap", PX_NOMIPMAP); |
| 4842 | context->RegisterEnumValue("TextureLoadFlags", "TextureLoadFlags_NoConvert", PX_NOCONVERT); |
| 4843 | context->RegisterEnumValue("TextureLoadFlags", "TextureLoadFlags_NoLiveUpdate", PX_NOLIVEUPDATE); |
| 4844 | context->RegisterEnumValue("TextureLoadFlags", "TextureLoadFlags_NoReduce", PX_NOREDUCE); |
| 4845 | |
| 4846 | // TextureAssetRef - This is a phoenix engine thing, not a Dear ImGui thing, but is necessary in order to feed images to Dear ImGui |
| 4847 | context->RegisterObjectType("TextureAssetRef", sizeof(TextureAssetRef), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK); |
| 4848 | context->RegisterObjectBehaviour("TextureAssetRef", asBEHAVE_CONSTRUCT, "void TextureAssetRef()", asFUNCTION(AS_TextureAssetRefConstructor), asCALL_CDECL_OBJFIRST); |
| 4849 | context->RegisterObjectBehaviour("TextureAssetRef", asBEHAVE_CONSTRUCT, "void TextureAssetRef(const TextureAssetRef &in other)", asFUNCTION(AS_TextureAssetRefCopyConstructor), asCALL_CDECL_OBJFIRST); |
| 4850 | context->RegisterObjectBehaviour("TextureAssetRef", asBEHAVE_DESTRUCT, "void TextureAssetRef()", asFUNCTION(AS_TextureAssetRefDestructor), asCALL_CDECL_OBJFIRST); |
| 4851 | context->RegisterObjectMethod("TextureAssetRef", "bool IsValid()", asMETHOD(TextureAssetRef, valid), asCALL_THISCALL); |
| 4852 | context->RegisterObjectMethod("TextureAssetRef", "void Clear()", asMETHOD(TextureAssetRef, clear), asCALL_THISCALL); |
| 4853 | context->RegisterObjectMethod("TextureAssetRef", "TextureAssetRef& opAssign(const TextureAssetRef &in other)", asFUNCTION(AS_TextureAssetRefOpAssign), asCALL_CDECL_OBJFIRST); |
| 4854 | context->RegisterObjectMethod("TextureAssetRef", "TextureAssetRef& opEquals(const TextureAssetRef &in other)", asFUNCTION(AS_TextureAssetRefOpEquals), asCALL_CDECL_OBJFIRST); |
| 4855 | context->RegisterObjectMethod("TextureAssetRef", "TextureAssetRef& opCmp(const TextureAssetRef &in other)", asFUNCTION(AS_TextureAssetRefOpCmp), asCALL_CDECL_OBJFIRST); |
| 4856 | |
| 4857 | context->RegisterGlobalFunction("TextureAssetRef LoadTexture(const string &in name, uint32 texture_load_flags = 0)", asFUNCTION(AS_LoadTexture), asCALL_CDECL); |
| 4858 | |
| 4859 | // Window |
| 4860 | context->RegisterGlobalFunction("bool ImGui_Begin(const string &in name, int flags = 0)", asFUNCTION(AS_ImGui_Begin), asCALL_CDECL, "bool ImGui_Begin(const string &in name, ImGuiWindowFlags flags = 0)"); |
| 4861 | context->RegisterGlobalFunction("bool ImGui_Begin(const string &in name, bool &inout is_open, int flags = 0)", asFUNCTION(AS_ImGui_Begin2), asCALL_CDECL, "bool ImGui_Begin(const string &in name, bool &inout is_open, ImGuiWindowFlags flags = 0)"); |
| 4862 | context->RegisterGlobalFunction("void ImGui_End()", asFUNCTION(AS_ImGui_End), asCALL_CDECL); |
| 4863 | context->RegisterGlobalFunction("bool ImGui_BeginChild(const string &in str_id, const vec2 &in size = vec2(0,0), bool border = false, int extra_flags = 0)", asFUNCTION(AS_ImGui_BeginChild), asCALL_CDECL, "bool ImGui_BeginChild(const string &in str_id, const vec2 &in size = vec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0)"); |
| 4864 | context->RegisterGlobalFunction("bool ImGui_BeginChild(uint id, const vec2 &in size = vec2(0,0), bool border = false, int extra_flags = 0)", asFUNCTION(AS_ImGui_BeginChild2), asCALL_CDECL, "bool ImGui_BeginChild(uint id, const vec2 &in size = vec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0)"); |
| 4865 | context->RegisterGlobalFunction("void ImGui_EndChild()", asFUNCTION(AS_ImGui_EndChild), asCALL_CDECL); |
| 4866 | context->RegisterGlobalFunction("vec2 ImGui_GetContentRegionMax()", asFUNCTION(AS_ImGui_GetContentRegionMax), asCALL_CDECL); |
| 4867 | context->RegisterGlobalFunction("vec2 ImGui_GetContentRegionAvail()", asFUNCTION(AS_ImGui_GetContentRegionAvail), asCALL_CDECL); |
| 4868 | context->RegisterGlobalFunction("float ImGui_GetContentRegionAvailWidth()", asFUNCTION(AS_ImGui_GetContentRegionAvailWidth), asCALL_CDECL); |
| 4869 | context->RegisterGlobalFunction("vec2 ImGui_GetWindowContentRegionMin()", asFUNCTION(AS_ImGui_GetWindowContentRegionMin), asCALL_CDECL); |
| 4870 | context->RegisterGlobalFunction("vec2 ImGui_GetWindowContentRegionMax()", asFUNCTION(AS_ImGui_GetWindowContentRegionMax), asCALL_CDECL); |
| 4871 | context->RegisterGlobalFunction("float ImGui_GetWindowContentRegionWidth()", asFUNCTION(AS_ImGui_GetWindowContentRegionWidth), asCALL_CDECL); |
| 4872 | context->RegisterGlobalFunction("vec2 ImGui_GetWindowPos()", asFUNCTION(AS_ImGui_GetWindowPos), asCALL_CDECL); |
| 4873 | context->RegisterGlobalFunction("vec2 ImGui_GetWindowSize()", asFUNCTION(AS_ImGui_GetWindowSize), asCALL_CDECL); |
| 4874 | context->RegisterGlobalFunction("float ImGui_GetWindowWidth()", asFUNCTION(AS_ImGui_GetWindowWidth), asCALL_CDECL); |
| 4875 | context->RegisterGlobalFunction("float ImGui_GetWindowHeight()", asFUNCTION(AS_ImGui_GetWindowHeight), asCALL_CDECL); |
| 4876 | context->RegisterGlobalFunction("bool ImGui_IsWindowCollapsed()", asFUNCTION(AS_ImGui_IsWindowCollapsed), asCALL_CDECL); |
| 4877 | context->RegisterGlobalFunction("bool ImGui_IsWindowAppearing()", asFUNCTION(AS_ImGui_IsWindowAppearing), asCALL_CDECL); |
| 4878 | context->RegisterGlobalFunction("void ImGui_SetWindowFontScale(float scale)", asFUNCTION(AS_ImGui_SetWindowFontScale), asCALL_CDECL); |
| 4879 | |
| 4880 | context->RegisterGlobalFunction("void ImGui_SetNextWindowPos(const vec2 &in pos, int cond = 0)", asFUNCTION(AS_ImGui_SetNextWindowPos), asCALL_CDECL, "void ImGui_SetNextWindowPos(const vec2 &in pos, ImGuiSetCond cond = 0)"); |
| 4881 | context->RegisterGlobalFunction("void ImGui_SetNextWindowPosCenter(int cond = 0)", asFUNCTION(AS_ImGui_SetNextWindowPosCenter), asCALL_CDECL, "void ImGui_SetNextWindowPosCenter(ImGuiSetCond cond = 0)"); |
| 4882 | context->RegisterGlobalFunction("void ImGui_SetNextWindowSize(const vec2 &in size, int cond = 0)", asFUNCTION(AS_ImGui_SetNextWindowSize), asCALL_CDECL, "void ImGui_SetNextWindowSize(const vec2 &in size, ImGuiSetCond cond = 0)"); |
| 4883 | context->RegisterGlobalFunction("void ImGui_SetNextWindowContentSize(const vec2 &in size)", asFUNCTION(AS_ImGui_SetNextWindowContentSize), asCALL_CDECL); |
| 4884 | context->RegisterGlobalFunction("void ImGui_SetNextWindowContentWidth(float width)", asFUNCTION(AS_ImGui_SetNextWindowContentWidth), asCALL_CDECL); |
| 4885 | context->RegisterGlobalFunction("void ImGui_SetNextWindowCollapsed(bool collapsed, int cond = 0)", asFUNCTION(AS_ImGui_SetNextWindowCollapsed), asCALL_CDECL, "void ImGui_SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0)"); |
| 4886 | context->RegisterGlobalFunction("void ImGui_SetNextWindowFocus()", asFUNCTION(AS_ImGui_SetNextWindowFocus), asCALL_CDECL); |
| 4887 | context->RegisterGlobalFunction("void ImGui_SetWindowPos(const vec2 &in pos, int cond = 0)", asFUNCTION(AS_ImGui_SetWindowPos), asCALL_CDECL, "void ImGui_SetWindowPos(const vec2 &in pos, ImGuiSetCond cond = 0)"); |
| 4888 | context->RegisterGlobalFunction("void ImGui_SetWindowSize(const vec2 &in size, int cond = 0)", asFUNCTION(AS_ImGui_SetWindowSize), asCALL_CDECL, "void ImGui_SetWindowSize(const vec2 &in size, ImGuiSetCond cond = 0)"); |
| 4889 | context->RegisterGlobalFunction("void ImGui_SetWindowCollapsed(bool collapsed, int cond = 0)", asFUNCTION(AS_ImGui_SetWindowCollapsed), asCALL_CDECL, "void ImGui_SetWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0)"); |
| 4890 | context->RegisterGlobalFunction("void ImGui_SetWindowFocus()", asFUNCTION(AS_ImGui_SetWindowFocus), asCALL_CDECL); |
| 4891 | context->RegisterGlobalFunction("void ImGui_SetWindowPos(const string &in name, const vec2 &in pos, int cond = 0)", asFUNCTION(AS_ImGui_SetWindowPos2), asCALL_CDECL, "void ImGui_SetWindowPos(const string &in name, const vec2 &in pos, ImGuiSetCond cond = 0)"); |
| 4892 | context->RegisterGlobalFunction("void ImGui_SetWindowSize(const string &in name, const vec2 &in size, int cond = 0)", asFUNCTION(AS_ImGui_SetWindowSize2), asCALL_CDECL, "void ImGui_SetWindowSize(const string &in name, const vec2 &in size, ImGuiSetCond cond = 0)"); |
| 4893 | context->RegisterGlobalFunction("void ImGui_SetWindowCollapsed(const string &in name, bool collapsed, int cond = 0)", asFUNCTION(AS_ImGui_SetWindowCollapsed2), asCALL_CDECL, "void ImGui_SetWindowCollapsed(const string &in name, bool collapsed, ImGuiSetCond cond = 0)"); |
| 4894 | context->RegisterGlobalFunction("void ImGui_SetWindowFocus(const string &in name)", asFUNCTION(AS_ImGui_SetWindowFocus2), asCALL_CDECL); |
no test coverage detected