summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/openglgraphics.cpp13
-rw-r--r--src/openglgraphics.h1
2 files changed, 11 insertions, 3 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 08a88f4f6..e53f4e11b 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -56,7 +56,12 @@ OpenGLGraphics::OpenGLGraphics():
mColorAlpha(false),
mFboId(0),
mTextureId(0),
+#ifdef DEBUG_BIND_TEXTURE
+ mRboId(0),
+ mOldTextureId(0)
+#else
mRboId(0)
+#endif
{
mOpenGL = 1;
mName = "fast OpenGL";
@@ -1400,11 +1405,13 @@ void OpenGLGraphics::debugBindTexture(const Image *image)
const std::string texture = image->getIdPath();
if (mOldTexture != texture)
{
- if (!mOldTexture.empty() && !texture.empty())
+ if (!mOldTexture.empty() && !texture.empty()
+ && mOldTextureId != image->mGLImage)
{
- logger->log("bind: %s to %s", mOldTexture.c_str(),
- texture.c_str());
+ logger->log("bind: %s (%d) to %s (%d)", mOldTexture.c_str(),
+ mOldTextureId, texture.c_str(), image->mGLImage);
}
+ mOldTextureId = image->mGLImage;
mOldTexture = texture;
}
}
diff --git a/src/openglgraphics.h b/src/openglgraphics.h
index eeb875a01..3eaf19045 100644
--- a/src/openglgraphics.h
+++ b/src/openglgraphics.h
@@ -166,6 +166,7 @@ class OpenGLGraphics : public Graphics
GLuint mRboId;
#ifdef DEBUG_BIND_TEXTURE
std::string mOldTexture;
+ unsigned mOldTextureId;
#endif
};
#endif