Extract app runtime tail, canvas camera shell, and preview sample services

This commit is contained in:
2026-06-16 22:40:17 +02:00
parent 338f115540
commit 5f76716732
10 changed files with 259 additions and 199 deletions

View File

@@ -108,6 +108,75 @@ void App::update(float dt)
pp::panopainter::update_legacy_canvas_toolbar(*this);
}
void App::clear()
{
const auto status = pp::renderer::gl::clear_panopainter_default_target(
pp::renderer::gl::OpenGlClearDispatch {
.clear_color = pp::legacy::ui_gl::set_opengl_clear_color,
.clear = pp::legacy::ui_gl::clear_opengl_buffer,
});
if (!status.ok())
LOG("OpenGL clear failed: %s", status.message);
}
bool App::check_license()
{
return true; // TODO: for distribuiton only
#if WITH_CURL
CURL* curl = curl_easy_init();
if (curl)
{
std::string url = "https://panopainter.com/license/7565D057-ACBE-4721-9A4E-F342D3DDB7D8.php";
//std::string url = "https://panopainter.com/license/E8EDC2FE-E1BD-4AB1-91BD-FCCD926739BD.php"; // wacom
//std::string url = "https://panopainter.com/license/A744FBA9-BC6C-43C8-BD24-0CCE24B3D985.php"; // others
std::string ret;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ret);
//curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_handler);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 2L);
if (disables_network_tls_verification())
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
const auto err = curl_easy_perform(curl);
curl_easy_cleanup(curl);
LOG("License check: %s", ret.c_str());
if (err == CURLcode::CURLE_OK && ret == "success")
return true;
}
#endif //CURL
return false;
}
void App::async_start()
{
acquire_render_context();
}
void App::async_redraw()
{
const auto plan = pp::app::plan_app_async_redraw();
if (plan.set_redraw)
redraw = true;
if (plan.notify_ui)
runtime_.notify_ui_worker();
}
void App::async_end()
{
release_render_context();
}
void App::async_swap()
{
present_render_context();
}
void App::terminate()
{
LOG("App::terminate");