Compare commits

..

2 Commits

5 changed files with 39 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <Core/Common/CoreTypes.h>
#include <Graphics/D3D12/D3D12Buffer.h>
#include <Juliet.h>
namespace Juliet
@@ -31,6 +32,11 @@ namespace Juliet
} // namespace Memory
namespace Debug
{
JULIET_API bool IsDebuggerPresent();
} // namespace Debug
using EntryPointFunc = int (*)(int, wchar_t**);
JULIET_API int Bootstrap(EntryPointFunc entryPointFunc, int argc, wchar_t** argv);
} // namespace Juliet

View File

@@ -21,6 +21,14 @@ namespace Juliet
}
} // namespace Memory
namespace Debug
{
bool IsDebuggerPresent()
{
return Internal::IsDebuggerPresent();
}
} // namespace Debug
int Bootstrap(EntryPointFunc entryPointFunc, int argc, wchar_t** argv)
{
return Internal::OS_Main(entryPointFunc, argc, argv);

View File

@@ -2,16 +2,17 @@
namespace Juliet
{
namespace Memory
namespace Memory::Internal
{
namespace Internal
{
Byte* OS_Reserve(size_t size);
bool OS_Commit(Byte* ptr, size_t size);
void OS_Release(Byte* ptr, size_t size);
} // namespace Internal
} // namespace Memory
Byte* OS_Reserve(size_t size);
bool OS_Commit(Byte* ptr, size_t size);
void OS_Release(Byte* ptr, size_t size);
} // namespace Memory::Internal
namespace Debug::Internal
{
bool IsDebuggerPresent();
} // namespace Debug::Internal
namespace Internal
{
int OS_Main(EntryPointFunc entryPointFunc, int argc, wchar_t** argv);

View File

@@ -39,6 +39,14 @@ namespace Juliet
}
} // namespace Memory::Internal
namespace Debug::Internal
{
bool IsDebuggerPresent()
{
return ::IsDebuggerPresent();
}
} // namespace Debug::Internal
namespace
{
// Used to handle a crash/exception
@@ -78,7 +86,8 @@ namespace Juliet
closesocket(Sock);
}
return entryPointFunc(argc, argv);
int result = entryPointFunc(argc, argv);
return result;
}
} // namespace Internal
} // namespace Juliet

View File

@@ -498,15 +498,15 @@ JulietApplication& GetEditorApplication()
return EditorApplication;
}
int JulietMain(int, wchar_t**)
int JulietMain(int argc, wchar_t** argv)
{
if (__argc > 1)
if (argc > 1)
{
for (int i = 1; i < __argc; ++i)
for (int i = 1; i < argc; ++i)
{
if (strcmp(__argv[i], "-autoclose") == 0 && (i + 1 < __argc))
if (wcscmp(argv[i], L"-autoclose") == 0 && (i + 1 < argc))
{
int frames = atoi(__argv[i + 1]);
int frames = _wtoi(argv[i + 1]);
EditorApplication.SetAutoCloseFrameCount(frames);
}
}
@@ -516,7 +516,7 @@ int JulietMain(int, wchar_t**)
// Pause here to not close the console window immediatly on stop
// Only pause if not in auto-close mode
if (EditorApplication.GetAutoCloseFrameCount() == -1)
if (EditorApplication.GetAutoCloseFrameCount() == -1 && !Debug::IsDebuggerPresent())
{
system("PAUSE");
}