diff --git a/enginecustom/Systemclass.cpp b/enginecustom/Systemclass.cpp index e47a23b..36c9b01 100644 --- a/enginecustom/Systemclass.cpp +++ b/enginecustom/Systemclass.cpp @@ -159,7 +159,7 @@ bool SystemClass::Frame() return false; } - // Render ImGui + // Render ImGui m_imguiManager->ImGuiWidgetRenderer(m_Application); return true; diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp index 36760fe..9c2c7a7 100644 --- a/enginecustom/applicationclass.cpp +++ b/enginecustom/applicationclass.cpp @@ -441,6 +441,7 @@ void ApplicationClass::Shutdown() delete[] m_MouseStrings; m_MouseStrings = 0; } + // Release the text object for the fps string. if (m_FpsString) { diff --git a/enginecustom/imguiManager.cpp b/enginecustom/imguiManager.cpp index 5c8e6eb..e0ead44 100644 --- a/enginecustom/imguiManager.cpp +++ b/enginecustom/imguiManager.cpp @@ -74,6 +74,31 @@ void imguiManager::WidgetAddObject(ApplicationClass* app) } ImGui::SameLine(); ImGui::Text("Number of cubes: %d", app->GetCubeCount()); + + if (ImGui::Button("Import Object")) + { + // Open file dialog + OPENFILENAME ofn; + WCHAR szFile[260]; + ZeroMemory(&ofn, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = NULL; + ofn.lpstrFile = szFile; + ofn.lpstrFile[0] = '\0'; + ofn.nMaxFile = sizeof(szFile); + ofn.lpstrFilter = L"OBJ\0*.obj\0TXT\0*.txt\0KOBJ\0*.kobj"; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + if (GetOpenFileName(&ofn)) + { + app->AddKobject(ofn.lpstrFile); + } + + } } }