mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Re-use parent console if it's available
* This means we won't get an ugly console window popping up when running renderdoccmd on windows, but if we run it from a terminal then we'll get output as normal. * One downside is that cmd.exe seems to snoop the exe type (GUI or console) and if it's a GUI application it returns to the prompt immediately. bash for example though waits for process termination. * The other is that pipe redirects to file don't work properly.
This commit is contained in:
@@ -808,6 +808,15 @@ int WINAPI wWinMain(_In_ HINSTANCE hInst, _In_opt_ HINSTANCE hPrevInstance, _In_
|
||||
LPWSTR *wargv;
|
||||
int argc;
|
||||
|
||||
if(AttachConsole(ATTACH_PARENT_PROCESS))
|
||||
{
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
|
||||
std::cout.sync_with_stdio();
|
||||
std::cerr.sync_with_stdio();
|
||||
}
|
||||
|
||||
wargv = CommandLineToArgvW(GetCommandLine(), &argc);
|
||||
|
||||
std::vector<std::string> argv;
|
||||
|
||||
Reference in New Issue
Block a user