Remove dead legacy GLFW retained state

This commit is contained in:
2026-06-17 10:59:10 +02:00
parent 0a7961d8b3
commit 06bfd62546
9 changed files with 33 additions and 53 deletions

View File

@@ -2,10 +2,6 @@
#include "platform_legacy/legacy_platform_state.h"
#include "platform_api/platform_policy.h"
#if defined(__LINUX__) || defined(__WEB__)
#include <GLFW/glfw3.h>
#endif
void webgl_pick_file_save(
const std::string& path,
const std::string& name,
@@ -21,12 +17,6 @@ struct RetainedLegacyAndroidStoragePaths final {
};
#endif
#if defined(__LINUX__) || defined(__WEB__)
struct RetainedLegacyGlfwPlatformState final {
GLFWwindow* window = nullptr;
};
#endif
struct RetainedLegacyWebPlatformServicesBinding final {
pp::platform::WebPlatformServices* services = nullptr;
};
@@ -39,14 +29,6 @@ struct RetainedLegacyWebPlatformServicesBinding final {
}
#endif
#if defined(__LINUX__) || defined(__WEB__)
[[nodiscard]] RetainedLegacyGlfwPlatformState& retained_legacy_glfw_platform_state()
{
static RetainedLegacyGlfwPlatformState state;
return state;
}
#endif
[[nodiscard]] RetainedLegacyWebPlatformServicesBinding& retained_legacy_web_platform_services_binding()
{
static RetainedLegacyWebPlatformServicesBinding state;
@@ -92,23 +74,6 @@ public:
}
#if defined(__LINUX__) || defined(__WEB__)
void set_legacy_glfw_window(GLFWwindow* window)
{
retained_legacy_glfw_platform_state().window = window;
}
void set_legacy_glfw_window_title(std::string_view title)
{
auto* const window = retained_legacy_glfw_platform_state().window;
if (!window)
return;
const std::string title_value(title);
glfwSetWindowTitle(window, title_value.c_str());
}
#endif
[[nodiscard]] pp::platform::WebPlatformServices& active_legacy_web_platform_services()
{
if (auto* services = retained_legacy_web_platform_services_binding().services)

View File

@@ -5,17 +5,8 @@
#include "platform_api/platform_policy.h"
#include "platform_api/platform_services.h"
#if __LINUX__ || __WEB__
struct GLFWwindow;
#endif
namespace pp::platform::legacy {
#if defined(__LINUX__) || defined(__WEB__)
void set_legacy_glfw_window(GLFWwindow* window);
void set_legacy_glfw_window_title(std::string_view title);
#endif
[[nodiscard]] pp::platform::WebPlatformServices& active_legacy_web_platform_services();
[[nodiscard]] std::unique_ptr<pp::platform::WebPlatformServices> create_legacy_web_platform_services();
void set_legacy_web_platform_services(pp::platform::WebPlatformServices* services);