diff options
author | Leith Bade <leith@mapbox.com> | 2014-12-24 08:12:20 +1300 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2014-12-24 08:12:20 +1300 |
commit | b93145afec4ae06ef90bf8d8cf5659ff428d7c6e (patch) | |
tree | 009d92887fc72dc1ff040a362ae7ba266a9b22c7 /src | |
parent | ae9fb18a8d5bd3ed21d2a6d7d48519a93c9f1086 (diff) | |
download | qtlocation-mapboxgl-b93145afec4ae06ef90bf8d8cf5659ff428d7c6e.tar.gz |
Tidy up a few missed things in shader.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/shader/shader.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mbgl/shader/shader.cpp b/src/mbgl/shader/shader.cpp index 62edf1d382..87e841f420 100644 --- a/src/mbgl/shader/shader.cpp +++ b/src/mbgl/shader/shader.cpp @@ -35,6 +35,7 @@ Shader::Shader(const char *name_, const GLchar *vertSource, const GLchar *fragSo std::unique_ptr<char[]> binary = mbgl::util::make_unique<char[]>(binaryLength); binaryFile.read(binary.get(), binaryLength); + binaryFile.close(); MBGL_CHECK_ERROR(gl::ProgramBinary(program, binaryFormat, binary.get(), binaryLength)); @@ -44,8 +45,6 @@ Shader::Shader(const char *name_, const GLchar *vertSource, const GLchar *fragSo if (status == GL_TRUE) { skipCompile = true; } - - binaryFile.close(); } GLuint vertShader = 0; @@ -142,7 +141,7 @@ bool Shader::compileShader(GLuint *shader, GLenum type, const GLchar *source) { *shader = MBGL_CHECK_ERROR(glCreateShader(type)); const GLchar *strings[] = { source }; - const GLsizei lengths[] = { (GLsizei)std::strlen(source) }; + const GLsizei lengths[] = { static_cast<GLsizei>(std::strlen(source)) }; MBGL_CHECK_ERROR(glShaderSource(*shader, 1, strings, lengths)); MBGL_CHECK_ERROR(glCompileShader(*shader)); |