add remote logging system using curl, normalize log messages removing \n, fix fra shaders precision issue, enable core and forward comp. in WGL, disable multisampling,

This commit is contained in:
2017-03-31 15:39:51 +01:00
parent ade95724e8
commit b1a3cb0309
18 changed files with 352 additions and 129 deletions

View File

@@ -39,6 +39,7 @@ add_library(
../engine/app.cpp
../engine/brush.cpp
../engine/canvas.cpp
../engine/log.cpp
)
target_include_directories(native-lib PRIVATE

View File

@@ -138,7 +138,7 @@ static int engine_init_display(struct engine* engine) {
engine->state.angle = 0;
// Check openGL on the system
auto opengl_info = {GL_VENDOR, GL_RENDERER, GL_VERSION, GL_EXTENSIONS};
auto opengl_info = {GL_VENDOR, GL_RENDERER, GL_VERSION/*, GL_EXTENSIONS*/};
for (auto name : opengl_info) {
auto info = glGetString(name);
LOG("OpenGL Info: %s", info);
@@ -294,46 +294,12 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
* android_native_app_glue. It runs in its own thread, with its own
* event loop for receiving input events and doing other things.
*/
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
LOG("READ SOMETHIND");
return size * nmemb;
}
int curl_test()
{
CURL *curl;
CURLcode res;
std::string readBuffer;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
LOG("READ: %s", readBuffer.c_str());
}
else
{
LOG("READ FAILED");
}
return 0;
}
void android_main(struct android_app* state) {
struct engine engine;
// Make sure glue isn't stripped.
app_dummy();
LOG("NETWORK TESTING...");
//curl_test();
LOG("NETWORK TESTED");
memset(&engine, 0, sizeof(engine));
state->userData = &engine;
state->onAppCmd = engine_handle_cmd;