Extract node lifecycle, preview runtime, and Win32 input state

This commit is contained in:
2026-06-16 22:18:30 +02:00
parent 24d9d5b6e2
commit 2a2f0c7dd6
12 changed files with 420 additions and 245 deletions

View File

@@ -6,7 +6,6 @@
#include "image.h"
#include "app.h"
#include "canvas.h"
#include "keymap.h"
#include "platform_windows/windows_bootstrap_helpers.h"
#include "platform_windows/windows_platform_services.h"
#include "platform_windows/windows_lifecycle_shell.h"
@@ -75,30 +74,6 @@ void win32_update_fps(int frames)
}));
}
// create a reverse map from kKey to VK_XXX
void init_vk_map()
{
auto& state = retained_state();
for (int k = 1; k < 256; k++) // ignore kKey::Unknown = 0
{
for (int vk = 0; vk < 256; vk++)
{
if (k == (int)convert_key(vk))
{
if (state.vkey_map.find((kKey)k) == state.vkey_map.end())
{
state.vkey_map.insert({ (kKey)k, vk });
}
else
{
LOG("KEY MAP COLLISION %d and %d maps to %d",
(int)vk, (int)state.vkey_map[(kKey)k], (int)k);
}
}
}
}
}
bool win32_vr_start()
{
auto& state = retained_state();
@@ -133,7 +108,7 @@ int main(int argc, char** argv)
pp::platform::windows::SplashScreen splash(GetModuleHandle(NULL));
init_vk_map();
pp::platform::windows::initialize_retained_input_state();
pp::platform::windows::setup_exception_handler();
@@ -141,7 +116,6 @@ int main(int argc, char** argv)
App::I->create();
memset(&state.keys, 0, sizeof(state.keys));
auto startup = pp::platform::windows::initialize_main_window_startup_state();
auto context = pp::platform::windows::OpenGlWindowContext {};
switch (pp::platform::windows::initialize_main_window_and_gl(startup, state.hWnd, state.hInst, state.window_title, context))