summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-03-19 14:02:10 +0100
committerAlf Watt <alf.watt@mapbox.com>2019-03-21 12:25:11 -0700
commitbf9e76c1cb2f6b0e1f6bc824d5c2d822595158b7 (patch)
treee88f9a2ffc25f8cac58382dec234b8023ed023c8 /src/mbgl/gl/context.cpp
parent19d70f5be90fdf1e269b99f0a9e253dcca839cf9 (diff)
downloadqtlocation-mapboxgl-bf9e76c1cb2f6b0e1f6bc824d5c2d822595158b7.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.cpp6
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;