2022-09-05 13:55:52 +08:00
|
|
|
#include "SBpch.h"
|
2022-09-08 11:48:32 +08:00
|
|
|
#include <Engine/SHEngine.h>
|
2022-09-08 12:51:23 +08:00
|
|
|
#include <Tools/SHLogger.h>
|
|
|
|
#include <Tools/SHExceptionHandler.h>
|
2022-09-08 11:48:32 +08:00
|
|
|
#include "Application/SBApplication.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define _CRTDBG_MAP_ALLOC
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <crtdbg.h>
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
|
|
|
|
// Replace _NORMAL_BLOCK with _CLIENT_BLOCK if you want the
|
|
|
|
// allocations to be of _CLIENT_BLOCK type
|
|
|
|
#else
|
|
|
|
#define DBG_NEW new
|
|
|
|
#endif
|
2022-09-05 13:55:52 +08:00
|
|
|
|
2022-09-08 19:11:25 +08:00
|
|
|
INT WINAPI wWinMain
|
2022-09-08 12:51:23 +08:00
|
|
|
(
|
2022-09-08 19:11:25 +08:00
|
|
|
_In_ HINSTANCE hInstance,
|
|
|
|
_In_opt_ HINSTANCE hPrevInstance,
|
|
|
|
_In_ LPWSTR lpCmdLine,
|
|
|
|
_In_ INT nCmdShow
|
2022-09-08 12:51:23 +08:00
|
|
|
)
|
2022-09-05 13:55:52 +08:00
|
|
|
{
|
2022-09-08 12:51:23 +08:00
|
|
|
const SHADE::SHLogger::Config LOGGER_CONFIG{ .directoryPath = "./logs/" };
|
2022-09-14 17:57:36 +08:00
|
|
|
auto logger = SHADE::SHLogger::Initialise(LOGGER_CONFIG);
|
2022-09-08 11:48:32 +08:00
|
|
|
|
2022-09-08 12:51:23 +08:00
|
|
|
try
|
|
|
|
{
|
|
|
|
#ifndef SHEDITOR
|
|
|
|
//ShowWindow(::GetConsoleWindow(), SW_HIDE);
|
2022-09-14 17:57:36 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
SHLOG_REGISTER(logger)
|
2022-09-08 12:51:23 +08:00
|
|
|
|
2022-09-08 19:11:25 +08:00
|
|
|
SHADE::SHEngine::Run<Sandbox::SBApplication>(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
|
2022-09-08 12:51:23 +08:00
|
|
|
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
SHADE::SHExceptionHandler::HandleException(std::current_exception());
|
|
|
|
SHADE::SHLogger::Shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
SHADE::SHLogger::Shutdown();
|
2022-09-08 11:48:32 +08:00
|
|
|
|
2022-09-05 13:55:52 +08:00
|
|
|
return 0;
|
|
|
|
}
|