6#include <Foundation/Logging/Log.h>
7#include <Foundation/Memory/MemoryTracker.h>
10#pragma warning(disable : 4447)
15namespace plApplicationDetails
17 PL_FOUNDATION_DLL
plResult InitializeWinrt();
18 PL_FOUNDATION_DLL
void UninitializeWinrt();
20 template <
typename AppClass,
typename... Args>
21 int EntryFunc(Args&&... arguments)
23 alignas(PL_ALIGNMENT_OF(AppClass))
static char appBuffer[
sizeof(AppClass)];
25 if (InitializeWinrt().Failed())
30 AppClass* pApp =
new (appBuffer) AppClass(std::forward<Args>(arguments)...);
34 const int iReturnCode = pApp->GetReturnCode();
37 std::string text = pApp->TranslateReturnCode();
39 printf(
"Return Code: '%s'\n", text.c_str());
49#define PL_CONSOLEAPP_ENTRY_POINT(AppClass, ...) \
50 alignas(PL_ALIGNMENT_OF(AppClass)) static char appBuffer[sizeof(AppClass)]; \
52 PL_APPLICATION_ENTRY_POINT_CODE_INJECTION \
53 int main(int argc, const char** argv) \
55 return ::plApplicationDetails::EntryFunc<AppClass>(__VA_ARGS__); \
62#define PL_APPLICATION_ENTRY_POINT(AppClass, ...) \
63 PL_APPLICATION_ENTRY_POINT_CODE_INJECTION \
64 int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) \
66 return ::plApplicationDetails::EntryFunc<AppClass>(__VA_ARGS__); \
Base class to be used by applications based on plEngine.
Definition Application.h:66
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
PL_ALWAYS_INLINE void IgnoreResult()
Used to silence compiler warnings, when success or failure doesn't matter.
Definition Types.h:69