MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / WindowsPlatformContext

Method WindowsPlatformContext

components/windows/src/context.cpp:83–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83WindowsPlatformContext::WindowsPlatformContext(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) :
84 PlatformContext{}
85{
86 _external_storage_directory = "";
87 _temp_directory = get_temp_path_from_environment();
88 _arguments = get_args();
89
90 // Attempt to attach to the parent process console if it exists
91 if (!AttachConsole(ATTACH_PARENT_PROCESS))
92 {
93 // No parent console, allocate a new one for this process
94 if (!AllocConsole())
95 {
96 throw std::runtime_error{"AllocConsole error"};
97 }
98 }
99
100 FILE *fp;
101 freopen_s(&fp, "conin$", "r", stdin);
102 freopen_s(&fp, "conout$", "w", stdout);
103 freopen_s(&fp, "conout$", "w", stderr);
104}
105} // namespace vkb

Callers

nothing calls this directly

Calls 2

get_argsFunction · 0.85

Tested by

no test coverage detected