Android opengl debug callback, Android device properties, fix texture internal format

This commit is contained in:
2017-04-02 11:35:11 +01:00
parent b1a3cb0309
commit 0dfb458c71
9 changed files with 135 additions and 35 deletions

View File

@@ -459,16 +459,17 @@ void App::init()
{ GL_DEBUG_SEVERITY_MEDIUM, FOREGROUND_GREEN | FOREGROUND_INTENSITY },
{ GL_DEBUG_SEVERITY_HIGH, FOREGROUND_RED | FOREGROUND_INTENSITY },
};
if (severity == GL_DEBUG_SEVERITY_MEDIUM || severity == GL_DEBUG_SEVERITY_HIGH)
if (severity == GL_DEBUG_SEVERITY_MEDIUM || severity == GL_DEBUG_SEVERITY_HIGH || severity == GL_DEBUG_SEVERITY_LOW)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), colors[severity]);
LOG("%.*s", length, message);
LOG("OPENGL: %.*s", length, message);
FlushConsoleInputBuffer(GetStdHandle(STD_OUTPUT_HANDLE));
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), info.wAttributes);
__debugbreak();
// __debugbreak();
}
}, nullptr);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
#endif
//int n;
@@ -550,7 +551,7 @@ bool App::mouse_down(int button, float x, float y)
e.m_type = button ? kEventType::MouseDownR : kEventType::MouseDownL;
e.m_pos = { x / zoom, y / zoom };
auto ret = layout[main_id]->on_event(&e);
LOG("mouse click button%d pos %f %f", button, x, y);
//LOG("mouse click button%d pos %f %f", button, x, y);
// if (popup)
// {
@@ -584,7 +585,7 @@ bool App::mouse_up(int button, float x, float y)
e.m_pos = { x / zoom, y / zoom };
auto ret = layout[main_id]->on_event(&e);
layout[main_id]->update();
LOG("mouse up button%d pos %f %f", button, x, y);
//LOG("mouse up button%d pos %f %f", button, x, y);
return ret == kEventResult::Consumed;
}
bool App::key_down(int key)
@@ -594,7 +595,7 @@ bool App::key_down(int key)
e.m_key = key;
auto ret = layout[main_id]->on_event(&e);
layout[main_id]->update();
LOG("key down %d '%c'", key, key);
//LOG("key down %d '%c'", key, key);
return ret == kEventResult::Consumed;
}
bool App::key_up(int key)
@@ -604,7 +605,7 @@ bool App::key_up(int key)
e.m_key = key;
auto ret = layout[main_id]->on_event(&e);
layout[main_id]->update();
LOG("key up %d '%c'", key, key);
//LOG("key up %d '%c'", key, key);
return ret == kEventResult::Consumed;
}
bool App::key_char(int key)
@@ -614,6 +615,6 @@ bool App::key_char(int key)
e.m_key = key;
auto ret = layout[main_id]->on_event(&e);
layout[main_id]->update();
LOG("key up %d '%c'", key, key);
//LOG("key up %d '%c'", key, key);
return ret == kEventResult::Consumed;
}