You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Now CVD can be built as an unreal program (in addition to being an editor tool). #jira UE-191890 #rb Benn.Gallagher [CL 32844991 by sergio gardeazabal in ue5-main branch]
60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ChaosVisualDebuggerMain.h"
|
|
#include "HAL/ExceptionHandling.h"
|
|
#include "Windows/WindowsHWrapper.h"
|
|
#include "LaunchEngineLoop.h"
|
|
#include "Misc/CommandLine.h"
|
|
#include "Misc/OutputDeviceError.h"
|
|
|
|
/**
|
|
* The main application entry point for the Visual debugger on Windows platforms.
|
|
*
|
|
* @param hInInstance Handle to the current instance of the application.
|
|
* @param hPrevInstance Handle to the previous instance of the application (always NULL).
|
|
* @param lpCmdLine Command line for the application.
|
|
* @param nShowCmd Specifies how the window is to be shown.
|
|
* @return Application's exit value.
|
|
*/
|
|
int32 WINAPI WinMain(_In_ HINSTANCE hInInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd)
|
|
{
|
|
hInstance = hInInstance;
|
|
|
|
const WIDECHAR* CmdLine = ::GetCommandLineW();
|
|
CmdLine = FCommandLine::RemoveExeName(CmdLine);
|
|
|
|
int32 ErrorLevel = 0;
|
|
|
|
#if UE_BUILD_DEBUG
|
|
if (!GAlwaysReportCrash)
|
|
#else
|
|
if (FPlatformMisc::IsDebuggerPresent() && !GAlwaysReportCrash)
|
|
#endif
|
|
{
|
|
ErrorLevel = RunChaosVisualDebugger(CmdLine);
|
|
}
|
|
else
|
|
{
|
|
#if !PLATFORM_SEH_EXCEPTIONS_DISABLED
|
|
__try
|
|
#endif
|
|
{
|
|
GIsGuarded = true;
|
|
ErrorLevel = RunChaosVisualDebugger(CmdLine);
|
|
GIsGuarded = false;
|
|
}
|
|
#if !PLATFORM_SEH_EXCEPTIONS_DISABLED
|
|
__except (ReportCrash(GetExceptionInformation()))
|
|
{
|
|
ErrorLevel = 1;
|
|
GError->HandleError();
|
|
FPlatformMisc::RequestExit(true);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
FEngineLoop::AppExit();
|
|
|
|
return ErrorLevel;
|
|
}
|