MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / ProcessCommandLine

Method ProcessCommandLine

Rtxpt/SampleCommon/SampleBaseApp.cpp:291–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291bool SampleBaseApp::ProcessCommandLine(int argc, char const* const* argv,
292 donut::app::DeviceCreationParameters& deviceParams, std::string& preferredScene)
293{
294#if 1 // use a bit larger window by default if screen large enough
295 glfwInit();
296 const auto primMonitor = glfwGetPrimaryMonitor();
297 const GLFWvidmode* mode = (primMonitor != nullptr) ? glfwGetVideoMode(primMonitor) : (nullptr);
298 if (mode->width > 2560 && mode->height > 1440)
299 {
300 m_CmdLine.width = 2560;
301 m_CmdLine.height = 1440;
302 }
303#endif
304 if (!m_CmdLine.InitFromCommandLine(__argc, __argv))
305 {
306 return false;
307 }
308
309 if (!m_CmdLine.scene.empty())
310 {
311 preferredScene = m_CmdLine.scene;
312 }
313
314 if (m_CmdLine.nonInteractive)
315 {
316 donut::log::EnableOutputToMessageBox(false);
317 HelpersSetNonInteractive();
318 }
319
320 if (m_CmdLine.debug)
321 {
322 deviceParams.enableDebugRuntime = true;
323 deviceParams.enableNvrhiValidationLayer = true;
324 }
325
326 deviceParams.backBufferWidth = m_CmdLine.width;
327 deviceParams.backBufferHeight = m_CmdLine.height;
328 deviceParams.startFullscreen = m_CmdLine.fullscreen;
329 deviceParams.adapterIndex = m_CmdLine.adapterIndex;
330
331 return true;
332}
333
334bool SampleBaseApp::InitDeviceAndWindow(const donut::app::DeviceCreationParameters& deviceParams)
335{

Callers

nothing calls this directly

Calls 3

HelpersSetNonInteractiveFunction · 0.85
InitFromCommandLineMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected