Minor Update - Import file
Feat : + Import Button to import from file a 3D object
This commit is contained in:
parent
3323dfa6ad
commit
bb15be5bd3
@ -159,7 +159,7 @@ bool SystemClass::Frame()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render ImGui
|
// Render ImGui
|
||||||
m_imguiManager->ImGuiWidgetRenderer(m_Application);
|
m_imguiManager->ImGuiWidgetRenderer(m_Application);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -441,6 +441,7 @@ void ApplicationClass::Shutdown()
|
|||||||
delete[] m_MouseStrings;
|
delete[] m_MouseStrings;
|
||||||
m_MouseStrings = 0;
|
m_MouseStrings = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release the text object for the fps string.
|
// Release the text object for the fps string.
|
||||||
if (m_FpsString)
|
if (m_FpsString)
|
||||||
{
|
{
|
||||||
|
@ -74,6 +74,31 @@ void imguiManager::WidgetAddObject(ApplicationClass* app)
|
|||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text("Number of cubes: %d", app->GetCubeCount());
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user