avoid some opengl redundant calls

master
Eduardo Bart 12 years ago
parent 70f14b5ac3
commit ee664657fb

@ -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)

@ -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()

Loading…
Cancel
Save