MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Blast / run

Method run

samples/SampleBase/core/Application.cpp:46–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46int Application::run()
47{
48 // FirstPersonCamera uses this timer, without it it will be FPS-dependent
49 DXUTGetGlobalTimer()->Start();
50
51 for (auto it = m_controllers.begin(); it != m_controllers.end(); it++)
52 m_deviceManager->AddControllerToFront(*it);
53
54 DeviceCreationParameters deviceParams;
55 deviceParams.swapChainFormat = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
56 deviceParams.swapChainSampleCount = 4;
57 deviceParams.startFullscreen = false;
58 deviceParams.backBufferWidth = 1600;
59 deviceParams.backBufferHeight = 900;
60#if defined(DEBUG) | defined(_DEBUG)
61 deviceParams.createDeviceFlags = D3D11_CREATE_DEVICE_DEBUG;
62#endif
63 deviceParams.featureLevel = D3D_FEATURE_LEVEL_11_0;
64
65 if (FAILED(m_deviceManager->CreateWindowDeviceAndSwapChain(deviceParams, m_sampleName.c_str())))
66 {
67 MessageBoxA(nullptr, "Cannot initialize the D3D11 device with the requested parameters", "Error",
68 MB_OK | MB_ICONERROR);
69 return 1;
70 }
71
72 for (auto it = m_controllers.begin(); it != m_controllers.end(); it++)
73 (*it)->onInitialize();
74
75 for (auto it = m_controllers.begin(); it != m_controllers.end(); it++)
76 (*it)->onSampleStart();
77
78 m_deviceManager->SetVsyncEnabled(false);
79 m_deviceManager->MessageLoop();
80
81 for (auto it = m_controllers.rbegin(); it != m_controllers.rend(); it++)
82 (*it)->onSampleStop();
83
84 for (auto it = m_controllers.rbegin(); it != m_controllers.rend(); it++)
85 (*it)->onTerminate();
86
87 m_deviceManager->Shutdown();
88 delete m_deviceManager;
89
90 return 0;
91}

Callers

nothing calls this directly

Calls 10

StartMethod · 0.80
AddControllerToFrontMethod · 0.80
SetVsyncEnabledMethod · 0.80
MessageLoopMethod · 0.80
ShutdownMethod · 0.80
onInitializeMethod · 0.45
onSampleStartMethod · 0.45
onSampleStopMethod · 0.45
onTerminateMethod · 0.45

Tested by

no test coverage detected