summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-08 02:50:15 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-08 02:50:15 +0300
commit373c794746bfe38d7abea0cedc446cb2aaa75c2e (patch)
tree03308276e8aabe045ed80f05f7382fe3f8553b5f /src/gui
parentcf09603b18f0158653723251445960d3bd534ea8 (diff)
downloadmanaplus-373c794746bfe38d7abea0cedc446cb2aaa75c2e.tar.gz
manaplus-373c794746bfe38d7abea0cedc446cb2aaa75c2e.tar.bz2
manaplus-373c794746bfe38d7abea0cedc446cb2aaa75c2e.tar.xz
manaplus-373c794746bfe38d7abea0cedc446cb2aaa75c2e.zip
Add opengl texture counter for debugging.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/debugwindow.cpp16
-rw-r--r--src/gui/debugwindow.h1
2 files changed, 15 insertions, 2 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index cbfce25dc..ddd2bc7db 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -124,7 +124,8 @@ void DebugWindow::widgetResized(const gcn::Event &event)
mTabs->setDimension(gcn::Rectangle(0, 0, getWidth(), getHeight()));
}
-MapDebugTab::MapDebugTab()
+MapDebugTab::MapDebugTab() :
+ mTexturesLabel(0)
{
LayoutHelper h(this);
ContainerPlacer place = h.getPlacer(0, 0);
@@ -169,7 +170,12 @@ MapDebugTab::MapDebugTab()
place(0, 5, mTileMouseLabel, 2);
place(0, 6, mParticleCountLabel, 2);
place(0, 7, mMapActorCountLabel, 2);
-
+#ifdef USE_OPENGL
+#ifdef DEBUG_OPENGL_LEAKS
+ mTexturesLabel = new Label(strprintf("%s %s", _("Textures count:"), "?"));
+ place(0, 8, mTexturesLabel, 2);
+#endif
+#endif
place.getCell().matchColWidth(0, 0);
place = h.getPlacer(0, 1);
setDimension(gcn::Rectangle(0, 0, 600, 300));
@@ -215,6 +221,12 @@ void MapDebugTab::logic()
mMapActorCountLabel->setCaption(
strprintf("%s %d", _("Map actors count:"),
map->getActorsCount()));
+#ifdef USE_OPENGL
+#ifdef DEBUG_OPENGL_LEAKS
+ mTexturesLabel->setCaption(strprintf("%s %d",
+ _("Textures count:"), textures_count));
+#endif
+#endif
}
}
else
diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h
index b3432946b..ae4b1b597 100644
--- a/src/gui/debugwindow.h
+++ b/src/gui/debugwindow.h
@@ -63,6 +63,7 @@ class MapDebugTab : public DebugTab
Label *mParticleCountLabel;
Label *mMapActorCountLabel;
Label *mXYLabel;
+ Label *mTexturesLabel;
int mUpdateTime;
Label *mFPSLabel;
std::string mFPSText;