From 2602774a9c0074a642f18f65dafdcbf7c2b7dadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 19 Feb 2014 14:48:54 +0100 Subject: [PATCH] bind texture 0 --- src/style/sprite.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/style/sprite.cpp b/src/style/sprite.cpp index e07cb89fd..a3e5d145c 100644 --- a/src/style/sprite.cpp +++ b/src/style/sprite.cpp @@ -236,11 +236,13 @@ void Sprite::bind(bool linear) { if (!texture) { glGenTextures(1, &texture); + glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.data()); } else { + glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture); }