Thin Windows runtime globals and legacy GLFW hooks

This commit is contained in:
2026-06-17 09:51:25 +02:00
parent 25eff166f6
commit 4c91701e11
9 changed files with 43 additions and 54 deletions

View File

@@ -9,20 +9,15 @@ struct GLFWwindow;
namespace pp::platform::legacy {
#if defined(__LINUX__) || defined(__WEB__)
struct RetainedLegacyGlfwWindowHooks final {
std::function<void()> acquire_render_context;
std::function<void()> present_render_context;
std::function<void()> request_app_close;
};
struct RetainedLegacyGlfwWindowState final {
GLFWwindow* window = nullptr;
RetainedLegacyGlfwWindowHooks hooks;
};
[[nodiscard]] RetainedLegacyGlfwWindowState& active_legacy_glfw_window_state();
[[nodiscard]] RetainedLegacyGlfwWindowHooks& active_legacy_glfw_window_hooks();
void set_legacy_glfw_window(GLFWwindow* window);
void acquire_legacy_glfw_render_context();
void present_legacy_glfw_render_context();
void request_legacy_glfw_app_close();
#endif
[[nodiscard]] pp::platform::WebPlatformServices& active_legacy_web_platform_services();