| 34 | static const std::string WEBP_FILE_EXT = ".webp"; |
| 35 | |
| 36 | unsigned LoadGLShader(const GLFunctions* gl, unsigned shaderType, const std::string& source) { |
| 37 | auto shader = gl->createShader(shaderType); |
| 38 | const char* files[] = {source.c_str()}; |
| 39 | gl->shaderSource(shader, 1, files, nullptr); |
| 40 | gl->compileShader(shader); |
| 41 | int success; |
| 42 | gl->getShaderiv(shader, GL_COMPILE_STATUS, &success); |
| 43 | if (!success) { |
| 44 | char infoLog[512]; |
| 45 | gl->getShaderInfoLog(shader, 512, nullptr, infoLog); |
| 46 | LOGE("Could not compile shader:\n%s\ntype:%d info%s", source.c_str(), shaderType, infoLog); |
| 47 | gl->deleteShader(shader); |
| 48 | shader = 0; |
| 49 | } |
| 50 | return shader; |
| 51 | } |
| 52 | |
| 53 | unsigned CreateGLProgram(Context* context, const std::string& vertex, const std::string& fragment) { |
| 54 | auto gl = GLFunctions::Get(context); |
no test coverage detected