more stuff

This commit is contained in:
Asuro
2025-02-24 05:29:24 +01:00
parent 369b994755
commit d3dcec1458
6 changed files with 156 additions and 6 deletions

View File

@@ -8,6 +8,7 @@
#include "SDL3/SDL_events.h"
#include "backends/imgui_impl_sdl3.h"
#include "bgfx/defines.h"
#include "bx/bx.h"
#include "bx/filepath.h"
#include "bx/math.h"
#include "bx/timer.h"
@@ -250,9 +251,15 @@ namespace Game
// platIO.Platform_SetWindowSize = TODO;
// platIO.Platform_RenderWindow = TODO;
if (!GetInstance().IsInitialized)
GameInstance& inst = GetInstance();
if (!inst.IsInitialized)
{
GetInstance().Time.StartTime = bx::getHPCounter();
inst.Time.StartTime = bx::getHPCounter();
}
if (inst.ImguiIniSize > 0)
{
ImGui::LoadIniSettingsFromMemory(inst.ImguiIni, inst.ImguiIniSize);
}
}
@@ -333,6 +340,11 @@ namespace Game
void GameRendering::Shutdown()
{
Log("--- RENDERING_SHUTDOWN ---");
const char* iniData = ImGui::SaveIniSettingsToMemory(reinterpret_cast<uint64_t*>(&GetInstance().ImguiIniSize));
assert(GetInstance().ImguiIniSize <= BX_COUNTOF(GameInstance::ImguiIni));
bx::memCopy(
GetInstance().ImguiIni, iniData, bx::min(GetInstance().ImguiIniSize, BX_COUNTOF(GameInstance::ImguiIni)));
ImGui_ImplSDL3_Shutdown();
imguiDestroy();
bgfx::shutdown();