diff --git a/src/framework/graphics/graphics.cpp b/src/framework/graphics/graphics.cpp index f58e029f..c2eb92cd 100644 --- a/src/framework/graphics/graphics.cpp +++ b/src/framework/graphics/graphics.cpp @@ -76,6 +76,9 @@ void Graphics::init() g_painterOGL2 = new PainterOGL2; #endif + // blending is always enabled + glEnable(GL_BLEND); + // determine max texture size static GLint maxTextureSize = -1; if(maxTextureSize == -1) @@ -213,7 +216,6 @@ void Graphics::beginRender() void Graphics::endRender() { - glFlush(); } void Graphics::setViewportSize(const Size& size) diff --git a/src/framework/graphics/painter.cpp b/src/framework/graphics/painter.cpp index 92054440..b6e84ad1 100644 --- a/src/framework/graphics/painter.cpp +++ b/src/framework/graphics/painter.cpp @@ -105,13 +105,14 @@ void Painter::setTexture(Texture* texture) m_texture = texture; if(texture) { - m_glTextureId = texture->getId(); setTextureMatrix(texture->getTransformMatrix()); - } else - m_glTextureId = 0; - m_texture = texture; - updateGlTexture(); + GLuint glTextureId = texture->getId(); + if(glTextureId != m_glTextureId) { + m_glTextureId = glTextureId; + updateGlTexture(); + } + } } void Painter::updateGlTexture()