MCPcopy Create free account
hub / github.com/TheRealMJP/MSAAFilter / Run

Method Run

SampleFramework11/v1.01/App.cpp:49–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49int32 App::Run()
50{
51 try
52 {
53 if(createConsole)
54 {
55 Win32Call(AllocConsole());
56 Win32Call(SetConsoleTitle(applicationName.c_str()));
57 FILE* consoleFile = nullptr;
58 freopen_s(&consoleFile, "CONOUT$", "wb", stdout);
59 }
60
61 if(showWindow)
62 window.ShowWindow();
63
64 deviceManager.Initialize(window);
65
66 blendStates.Initialize(deviceManager.Device());
67 rasterizerStates.Initialize(deviceManager.Device());
68 depthStencilStates.Initialize(deviceManager.Device());
69 samplerStates.Initialize(deviceManager.Device());
70
71 // Create a font + SpriteRenderer
72 font.Initialize(L"Arial", 18, SpriteFont::Regular, true, deviceManager.Device());
73 spriteRenderer.Initialize(deviceManager.Device());
74
75 Profiler::GlobalProfiler.Initialize(deviceManager.Device(), deviceManager.ImmediateContext());
76
77 window.RegisterMessageCallback(WM_SIZE, OnWindowResized, this);
78
79 // Initialize AntTweakBar
80 TwCall(TwInit(TW_DIRECT3D11, deviceManager.Device()));
81
82 // Create a tweak bar
83 tweakBar = TwNewBar("Settings");
84 TwCall(TwDefine(" GLOBAL help='MJPs sample framework for DX11' "));
85 TwCall(TwDefine(" GLOBAL fontsize=3 "));
86
87 Settings.Initialize(tweakBar);
88
89 TwHelper::SetValuesWidth(Settings.TweakBar(), 120, false);
90
91 AppSettings::Initialize(deviceManager.Device());
92
93 Initialize();
94
95 AfterReset();
96
97 while(window.IsAlive())
98 {
99 if(!window.IsMinimized())
100 {
101 timer.Update();
102 Settings.Update();
103
104 CalculateFPS();
105
106 AppSettings::Update();

Callers 1

wWinMainFunction · 0.45

Calls 15

Win32CallFunction · 0.85
TwCallFunction · 0.85
SetValuesWidthFunction · 0.85
InitializeFunction · 0.85
UpdateFunction · 0.85
UpdateShadersFunction · 0.85
UpdateCBufferFunction · 0.85
ShutdownShadersFunction · 0.85
ShowWindowMethod · 0.80
DeviceMethod · 0.80
ImmediateContextMethod · 0.80

Tested by

no test coverage detected