@@ -89,13 +89,14 @@ namespace Editor::ProjectHub::Internal {
8989 return result;
9090 }
9191
92- static std::string LaunchCommand (const std::string& inExecutable, const std::string& inProjectPath, const std::string& inRhiType, bool inGpuDebug)
92+ static std::string LaunchCommand (const std::string& inExecutable, const std::string& inProjectPath, const std::string& inRhiType, bool inGpuDebug, bool inSoftwareGpu )
9393 {
9494 const std::string gpuDebugArg = inGpuDebug ? " -gpuDebug" : " " ;
95+ const std::string softwareGpuArg = inSoftwareGpu ? " -softwareGpu" : " " ;
9596#if PLATFORM_WINDOWS
96- return std::format (" start \"\" \" {}\" -project \" {}\" -rhi {}{}" , inExecutable, inProjectPath, inRhiType, gpuDebugArg);
97+ return std::format (" start \"\" \" {}\" -project \" {}\" -rhi {}{}{} " , inExecutable, inProjectPath, inRhiType, gpuDebugArg, softwareGpuArg );
9798#else
98- return std::format (" \" {}\" -project \" {}\" -rhi {}{} &" , inExecutable, inProjectPath, inRhiType, gpuDebugArg);
99+ return std::format (" \" {}\" -project \" {}\" -rhi {}{}{} &" , inExecutable, inProjectPath, inRhiType, gpuDebugArg, softwareGpuArg );
99100#endif
100101 }
101102}
@@ -126,7 +127,7 @@ namespace Editor {
126127 SaveRecentProjects ();
127128 }
128129
129- void ProjectHubFrame::Render (EditorWindow& inWindow, const std::string& inRhiType, bool inGpuDebug)
130+ void ProjectHubFrame::Render (EditorWindow& inWindow, const std::string& inRhiType, bool inGpuDebug, bool inSoftwareGpu )
130131 {
131132 const ImGuiViewport* viewport = ImGui::GetMainViewport ();
132133 ImGui::SetNextWindowPos (viewport->WorkPos );
@@ -143,21 +144,21 @@ namespace Editor {
143144 | ImGuiWindowFlags_NoBringToFrontOnFocus);
144145 ImGui::PopStyleVar (2 );
145146
146- RenderActionBar (inWindow, inRhiType, inGpuDebug);
147+ RenderActionBar (inWindow, inRhiType, inGpuDebug, inSoftwareGpu );
147148 ImGui::Dummy (ImVec2 (0 .0f , 22 .0f ));
148- RenderRecentProjects (inWindow, inRhiType, inGpuDebug);
149- RenderCreateProjectPopup (inWindow, inRhiType, inGpuDebug);
149+ RenderRecentProjects (inWindow, inRhiType, inGpuDebug, inSoftwareGpu );
150+ RenderCreateProjectPopup (inWindow, inRhiType, inGpuDebug, inSoftwareGpu );
150151 ImGui::End ();
151152 }
152153
153- void ProjectHubFrame::RenderActionBar (EditorWindow& inWindow, const std::string& inRhiType, bool inGpuDebug)
154+ void ProjectHubFrame::RenderActionBar (EditorWindow& inWindow, const std::string& inRhiType, bool inGpuDebug, bool inSoftwareGpu )
154155 {
155156 const float spacing = ImGui::GetStyle ().ItemSpacing .x ;
156157 const float buttonWidth = (ImGui::GetContentRegionAvail ().x - spacing) * 0 .5f ;
157158 const std::string openLabel = Widgets::Label (Icons::Tabler::folderOpen, " Open" );
158159 if (Widgets::PrimaryButton (openLabel.c_str (), ImVec2 (buttonWidth, ProjectHub::Internal::actionButtonHeight))) {
159160 if (const auto selectedDirectory = PlatformUtils::SelectDirectory (" Open Explosion Project" )) {
160- OpenProject (inWindow, *selectedDirectory, inRhiType, inGpuDebug);
161+ OpenProject (inWindow, *selectedDirectory, inRhiType, inGpuDebug, inSoftwareGpu );
161162 }
162163 }
163164
@@ -169,7 +170,7 @@ namespace Editor {
169170 }
170171 }
171172
172- void ProjectHubFrame::RenderRecentProjects (EditorWindow& inWindow, const std::string& inRhiType, bool inGpuDebug)
173+ void ProjectHubFrame::RenderRecentProjects (EditorWindow& inWindow, const std::string& inRhiType, bool inGpuDebug, bool inSoftwareGpu )
173174 {
174175 const std::string recentProjectsLabel = Widgets::Label (Icons::Tabler::folder, " Recent projects" );
175176 ImGui::TextUnformatted (recentProjectsLabel.c_str ());
@@ -209,11 +210,11 @@ namespace Editor {
209210 ImGui::EndChild ();
210211
211212 if (!projectToOpen.empty ()) {
212- OpenProject (inWindow, projectToOpen, inRhiType, inGpuDebug);
213+ OpenProject (inWindow, projectToOpen, inRhiType, inGpuDebug, inSoftwareGpu );
213214 }
214215 }
215216
216- void ProjectHubFrame::RenderCreateProjectPopup (EditorWindow& inWindow, const std::string& inRhiType, bool inGpuDebug)
217+ void ProjectHubFrame::RenderCreateProjectPopup (EditorWindow& inWindow, const std::string& inRhiType, bool inGpuDebug, bool inSoftwareGpu )
217218 {
218219 const ImGuiViewport* viewport = ImGui::GetMainViewport ();
219220 ImGui::SetNextWindowPos (viewport->GetCenter (), ImGuiCond_Appearing, ImVec2 (0 .5f , 0 .5f ));
@@ -288,7 +289,7 @@ namespace Editor {
288289 if (result.success ) {
289290 statusMessage.clear ();
290291 ImGui::CloseCurrentPopup ();
291- OpenProject (inWindow, result.projectPath , inRhiType, inGpuDebug);
292+ OpenProject (inWindow, result.projectPath , inRhiType, inGpuDebug, inSoftwareGpu );
292293 } else {
293294 statusMessage = result.error ;
294295 }
@@ -327,7 +328,7 @@ namespace Editor {
327328 return { .success = true , .error = {}, .projectPath = projectDir.String () };
328329 }
329330
330- void ProjectHubFrame::OpenProject (EditorWindow& inWindow, const std::string& inProjectPath, const std::string& inRhiType, bool inGpuDebug)
331+ void ProjectHubFrame::OpenProject (EditorWindow& inWindow, const std::string& inProjectPath, const std::string& inRhiType, bool inGpuDebug, bool inSoftwareGpu )
331332 {
332333 const Common::Path projectDir (inProjectPath);
333334 if (!projectDir.Exists () || !projectDir.IsDirectory ()) {
@@ -338,7 +339,7 @@ namespace Editor {
338339 TouchRecentProject (inProjectPath);
339340 SaveRecentProjects ();
340341
341- const std::string command = ProjectHub::Internal::LaunchCommand (Core::Paths::ExecutablePath ().String (), inProjectPath, inRhiType, inGpuDebug);
342+ const std::string command = ProjectHub::Internal::LaunchCommand (Core::Paths::ExecutablePath ().String (), inProjectPath, inRhiType, inGpuDebug, inSoftwareGpu );
342343 std::ignore = std::system (command.c_str ());
343344 inWindow.RequestClose ();
344345 }
0 commit comments