You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
#fyi Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
[CL 5304722 by Ben Marsh in 4.22 branch]
92 lines
1.8 KiB
C++
92 lines
1.8 KiB
C++
// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
|
|
|
|
#include "LC_Event.h"
|
|
#include "LC_Logging.h"
|
|
#include "Windows/WindowsHWrapper.h"
|
|
|
|
|
|
Event::Event(const wchar_t* name, Type::Enum type)
|
|
: m_event(::CreateEventW(NULL, (type == Type::MANUAL_RESET) ? Windows::TRUE : Windows::FALSE, Windows::FALSE, name))
|
|
{
|
|
const DWORD error = ::GetLastError();
|
|
if (m_event == NULL)
|
|
{
|
|
LC_ERROR_USER("Cannot create event %S. Error: 0x%X", name ? name : L"(unnamed)", error);
|
|
}
|
|
else if (error == ERROR_ALREADY_EXISTS)
|
|
{
|
|
// another process already created this event, this is to be expected
|
|
}
|
|
}
|
|
|
|
|
|
Event::~Event(void)
|
|
{
|
|
::CloseHandle(m_event);
|
|
}
|
|
|
|
|
|
void Event::Signal(void)
|
|
{
|
|
::SetEvent(m_event);
|
|
}
|
|
|
|
|
|
void Event::Reset(void)
|
|
{
|
|
::ResetEvent(m_event);
|
|
}
|
|
|
|
|
|
void Event::Wait(void)
|
|
{
|
|
const DWORD result = ::WaitForSingleObject(m_event, INFINITE);
|
|
switch (result)
|
|
{
|
|
case WAIT_OBJECT_0:
|
|
// event was successfully signaled
|
|
break;
|
|
|
|
case WAIT_TIMEOUT:
|
|
// the operation timed out, which should never happen with a timeout of INFINITE
|
|
LC_ERROR_DEV("Event timed out.");
|
|
break;
|
|
|
|
case WAIT_ABANDONED:
|
|
LC_ERROR_DEV("Wait() was called on a stale event which was not released by the owning thread.");
|
|
break;
|
|
|
|
case WAIT_FAILED:
|
|
LC_ERROR_DEV("Failed to Wait() on an event.");
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
bool Event::WaitTimeout(unsigned int milliSeconds)
|
|
{
|
|
const DWORD result = ::WaitForSingleObject(m_event, milliSeconds);
|
|
switch (result)
|
|
{
|
|
case WAIT_OBJECT_0:
|
|
return true;
|
|
|
|
case WAIT_TIMEOUT:
|
|
return false;
|
|
|
|
case WAIT_ABANDONED:
|
|
LC_ERROR_DEV("Wait() was called on a stale event which was not released by the owning thread.");
|
|
return false;
|
|
|
|
case WAIT_FAILED:
|
|
LC_ERROR_DEV("Failed to Wait() on an event.");
|
|
return false;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
}
|