Extract app runtime tail, canvas camera shell, and preview sample services
This commit is contained in:
69
src/app.cpp
69
src/app.cpp
@@ -63,17 +63,6 @@ bool App::request_close()
|
||||
return close_decision == pp::app::CloseRequestDecision::close_now;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void App::initAssets()
|
||||
{
|
||||
pp::panopainter::execute_legacy_app_init_assets(*this);
|
||||
@@ -89,69 +78,11 @@ namespace pp::panopainter
|
||||
bool update_legacy_app_ui_observer(App& app, Node* n);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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::init()
|
||||
{
|
||||
pp::panopainter::execute_legacy_app_init(*this);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
bool App::update_ui_observer(Node *n)
|
||||
{
|
||||
return pp::panopainter::update_legacy_app_ui_observer(*this, n);
|
||||
|
||||
Reference in New Issue
Block a user