add webgl support

This commit is contained in:
2019-10-05 21:08:40 +02:00
parent a1c0dcb007
commit f2a73a905d
19 changed files with 370 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ LogRemote LogRemote::I;
void LogRemote::start()
{
#if WITH_CURL
if (m_running || m_error)
return; // already running
@@ -27,6 +28,7 @@ void LogRemote::start()
net_close();
LOG("NET thread loop exit");
});
#endif //CURL
}
void LogRemote::stop()
@@ -39,6 +41,7 @@ void LogRemote::stop()
void LogRemote::net_init()
{
#if WITH_CURL
if (!(curl = curl_easy_init()))
return;
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &this->readBuffer);
@@ -48,10 +51,12 @@ void LogRemote::net_init()
#ifdef __ANDROID__
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
#endif //CURL
}
std::string LogRemote::net_request(std::string cmd, std::string data /*= ""*/)
{
readBuffer.clear();
#if WITH_CURL
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data.c_str());
auto url = m_url + cmd;
@@ -63,13 +68,16 @@ std::string LogRemote::net_request(std::string cmd, std::string data /*= ""*/)
m_running = false;
m_error = true;
}
#endif //CURL
return readBuffer;
}
void LogRemote::net_close()
{
#if WITH_CURL
if (curl)
curl_easy_cleanup(curl);
curl = nullptr;
#endif //CURL
m_running = false;
}
void LogRemote::file_init()