From d2b9b1c348ba71189792f1f6ba6c450729cd9a12 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 1 Apr 2016 17:23:46 -0700 Subject: [core] always set activeTexture before binding a texture --- include/mbgl/gl/gl_values.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/mbgl/gl/gl_values.hpp') diff --git a/include/mbgl/gl/gl_values.hpp b/include/mbgl/gl/gl_values.hpp index a5d413f5af..2ebfe2e687 100644 --- a/include/mbgl/gl/gl_values.hpp +++ b/include/mbgl/gl/gl_values.hpp @@ -240,6 +240,19 @@ struct LineWidth { } }; +struct ActiveTexture { + using Type = GLint; + static const Type Default; + inline static void Set(const Type& value) { + MBGL_CHECK_ERROR(glActiveTexture(value)); + } + inline static Type Get() { + Type activeTexture; + MBGL_CHECK_ERROR(glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTexture)); + return activeTexture; + } +}; + #ifndef GL_ES_VERSION_2_0 struct PixelZoom { -- cgit v1.2.1