Own legacy platform services on Linux
This commit is contained in:
@@ -70,6 +70,12 @@ What is already real:
|
||||
- `pp_app_core`
|
||||
|
||||
Latest slice:
|
||||
- `src/platform_legacy/legacy_platform_services.*` now exposes an ownable
|
||||
`create_platform_services()` entrypoint alongside the legacy fallback
|
||||
accessor.
|
||||
- `linux/src/main.cpp` now owns a local legacy `PlatformServices` instance and
|
||||
binds it into `App` explicitly instead of binding the process-global legacy
|
||||
accessor directly.
|
||||
- `src/app_events.cpp` no longer silently falls back to
|
||||
`pp::platform::legacy::platform_services()` when `App` has no bound platform
|
||||
services; the live app path now expects explicit platform-service ownership.
|
||||
|
||||
@@ -78,6 +78,12 @@ Completed, blocked, and superseded task history moved to
|
||||
the queue is now ordered by code movement instead.
|
||||
|
||||
Current slice:
|
||||
- `src/platform_legacy/legacy_platform_services.*` now exposes an ownable
|
||||
`create_platform_services()` entrypoint while keeping the fallback singleton
|
||||
for non-migrated platforms.
|
||||
- `linux/src/main.cpp` now binds an owned legacy `PlatformServices` instance
|
||||
into `App`, making Linux the first explicit per-entrypoint owner of that
|
||||
legacy service implementation.
|
||||
- `src/app_events.cpp` no longer hides a fallback to
|
||||
`pp::platform::legacy::platform_services()`; touched app platform dispatch
|
||||
now expects an explicitly bound platform-services pointer.
|
||||
|
||||
@@ -55,6 +55,7 @@ void error_log(int code, const char * s)
|
||||
|
||||
int main(int argc, char** args)
|
||||
{
|
||||
auto platform_services = pp::platform::legacy::create_platform_services();
|
||||
GLFWwindow* wnd = nullptr;
|
||||
glfwSetErrorCallback(error_log);
|
||||
if (!glfwInit())
|
||||
@@ -121,7 +122,7 @@ int main(int argc, char** args)
|
||||
|
||||
App::I = &app;
|
||||
pp::platform::legacy::set_legacy_glfw_window(wnd);
|
||||
app.set_platform_services(&pp::platform::legacy::platform_services());
|
||||
app.set_platform_services(platform_services.get());
|
||||
app.initLog();
|
||||
app.create();
|
||||
app.width = 800;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "platform_legacy/legacy_platform_services.h"
|
||||
#include "platform_legacy/legacy_platform_state.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "legacy_ui_gl_dispatch.h"
|
||||
#include "log.h"
|
||||
#include "platform_apple/apple_platform_services.h"
|
||||
@@ -552,4 +554,9 @@ PlatformServices& platform_services()
|
||||
static LegacyPlatformServices services;
|
||||
return services;
|
||||
}
|
||||
|
||||
std::unique_ptr<PlatformServices> create_platform_services()
|
||||
{
|
||||
return std::make_unique<LegacyPlatformServices>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "platform_api/platform_services.h"
|
||||
|
||||
namespace pp::platform::legacy {
|
||||
|
||||
[[nodiscard]] PlatformServices& platform_services();
|
||||
[[nodiscard]] std::unique_ptr<PlatformServices> create_platform_services();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user