Route startup resources through app core
This commit is contained in:
@@ -3,13 +3,16 @@
|
||||
#include "legacy_app_startup_services.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "renderer_gl/opengl_capabilities.h"
|
||||
#include "serializer.h"
|
||||
#include "settings.h"
|
||||
|
||||
namespace pp::panopainter {
|
||||
namespace {
|
||||
|
||||
class LegacyAppStartupServices final : public pp::app::AppStartupServices {
|
||||
class LegacyAppStartupServices final
|
||||
: public pp::app::AppStartupServices
|
||||
, public pp::app::AppStartupResourceServices {
|
||||
public:
|
||||
explicit LegacyAppStartupServices(App& app) noexcept
|
||||
: app_(app)
|
||||
@@ -43,6 +46,36 @@ public:
|
||||
app_.message_box("License", "Could not validate this license, running in demo mode.");
|
||||
}
|
||||
|
||||
void initialize_shaders() override
|
||||
{
|
||||
app_.initShaders();
|
||||
}
|
||||
|
||||
void initialize_assets() override
|
||||
{
|
||||
app_.initAssets();
|
||||
}
|
||||
|
||||
void initialize_layout() override
|
||||
{
|
||||
app_.initLayout();
|
||||
}
|
||||
|
||||
void update_title() override
|
||||
{
|
||||
app_.title_update();
|
||||
}
|
||||
|
||||
void create_ui_render_target(int width, int height) override
|
||||
{
|
||||
app_.uirtt.create(
|
||||
width,
|
||||
height,
|
||||
-1,
|
||||
static_cast<GLint>(pp::renderer::gl::rgba8_internal_format()),
|
||||
true);
|
||||
}
|
||||
|
||||
private:
|
||||
App& app_;
|
||||
};
|
||||
@@ -73,4 +106,12 @@ pp::foundation::Status execute_legacy_app_startup_runtime_plan(
|
||||
return pp::app::execute_app_startup_runtime_plan(plan, services);
|
||||
}
|
||||
|
||||
pp::foundation::Status execute_legacy_app_startup_resources(
|
||||
App& app,
|
||||
const pp::app::AppStartupResourcePlan& plan)
|
||||
{
|
||||
LegacyAppStartupServices services(app);
|
||||
return pp::app::execute_app_startup_resources(plan, services);
|
||||
}
|
||||
|
||||
} // namespace pp::panopainter
|
||||
|
||||
Reference in New Issue
Block a user