mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Only bind images when they weren't (issue #353)
This commit is contained in:
@@ -262,8 +262,15 @@ namespace opengl
|
|||||||
|
|
||||||
void Image::bind() const
|
void Image::bind() const
|
||||||
{
|
{
|
||||||
if (texture != 0)
|
if (texture == 0)
|
||||||
glBindTexture(GL_TEXTURE_2D,texture);
|
return;
|
||||||
|
|
||||||
|
GLuint boundTex;
|
||||||
|
glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *)&boundTex);
|
||||||
|
|
||||||
|
// only bind if this texture is not already bound
|
||||||
|
if (boundTex != texture)
|
||||||
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Image::load()
|
bool Image::load()
|
||||||
|
|||||||
Reference in New Issue
Block a user