diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-19 14:02:10 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-20 15:40:47 +0100 |
commit | 1e30fdac36233c0fd0662e2b285b0424907bc81d (patch) | |
tree | eb61b156b5445639939eab47f5ded9a385b25fd9 /src/mbgl/gl/context.cpp | |
parent | 53ab65d81165daf4e23ce28fa0e42861724ea687 (diff) | |
download | qtlocation-mapboxgl-1e30fdac36233c0fd0662e2b285b0424907bc81d.tar.gz |
[core] move ProgramMap to within the gl::Program object
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r-- | src/mbgl/gl/context.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 1f780331c2..eff3c2160c 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -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; |