fix: android comptatibility

This commit is contained in:
2021-11-02 11:11:51 +01:00
parent 0c68512caf
commit 1768b3473d
7 changed files with 188 additions and 45 deletions

View File

@@ -12,6 +12,10 @@
#include <glm/gtc/type_ptr.hpp>
#ifdef ANDROID
#include <android/log.h>
#endif
ShaderProgram::ShaderProgram() :
programID(0), vertexShaderID(0), fragmentShaderID(0) {
}
@@ -112,6 +116,9 @@ int ShaderProgram::loadShader(const std::string& source, GLenum type) {
char error[size];
glGetShaderInfoLog(shaderID, size, &size, error);
std::cout << error << std::endl;
#ifdef ANDROID
__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "Could not compile shader !\n %s", error);
#endif
}
return shaderID;
}