[core] move ProgramMap to within the gl::Program object

This commit is contained in:
Konstantin Käfer
2019-03-19 14:02:10 +01:00
parent 53ab65d811
commit 1e30fdac36
53 changed files with 822 additions and 330 deletions

View File

@@ -160,12 +160,10 @@ void Context::enableDebugging() {
MBGL_CHECK_ERROR(debugging->debugMessageCallback(extension::Debugging::DebugCallback, nullptr));
}
UniqueShader Context::createShader(ShaderType type, const std::string& source) {
UniqueShader Context::createShader(ShaderType type, const std::initializer_list<const char*>& sources) {
UniqueShader result { MBGL_CHECK_ERROR(glCreateShader(static_cast<GLenum>(type))), { this } };
const GLchar* sources = source.data();
const auto lengths = static_cast<GLsizei>(source.length());
MBGL_CHECK_ERROR(glShaderSource(result, 1, &sources, &lengths));
MBGL_CHECK_ERROR(glShaderSource(result, static_cast<GLsizei>(sources.size()), sources.begin(), nullptr));
MBGL_CHECK_ERROR(glCompileShader(result));
GLint status = 0;