mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Don't query the current texture bindings when initializing OpenGL.
This commit is contained in:
@@ -136,19 +136,14 @@ void OpenGL::setupContext()
|
||||
state.boundTextures.clear();
|
||||
state.boundTextures.resize(maxTextureUnits, 0);
|
||||
|
||||
GLenum curgltextureunit;
|
||||
glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *) &curgltextureunit);
|
||||
|
||||
state.curTextureUnit = (int) curgltextureunit - GL_TEXTURE0;
|
||||
|
||||
// Retrieve currently bound textures for each texture unit.
|
||||
for (int i = 0; i < (int) state.boundTextures.size(); i++)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE0 + i);
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &state.boundTextures[i]);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
glActiveTexture(curgltextureunit);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
state.curTextureUnit = 0;
|
||||
|
||||
createDefaultTexture();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user