From b136733d578dd7a394c62302212b02c714775ec6 Mon Sep 17 00:00:00 2001 From: daid Date: Mon, 24 Jun 2013 11:37:01 +0200 Subject: [PATCH] Draw FPS on dev version. --- Cura/gui/util/openglGui.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cura/gui/util/openglGui.py b/Cura/gui/util/openglGui.py index 599aaed1..764c88a5 100644 --- a/Cura/gui/util/openglGui.py +++ b/Cura/gui/util/openglGui.py @@ -13,6 +13,7 @@ import OpenGL OpenGL.ERROR_CHECKING = False from OpenGL.GL import * +from Cura.util import version from Cura.gui.util import opengl class animation(object): @@ -220,9 +221,16 @@ class glGuiPanel(glcanvas.GLCanvas): for obj in self.glReleaseList: obj.release() del self.glReleaseList[:] + renderStartTime = time.time() self.OnPaint(e) self._drawGui() glFlush() + if version.isDevVersion(): + renderTime = time.time() - renderStartTime + glLoadIdentity() + glTranslate(10, self.GetSize().GetHeight() - 30, -1) + glColor4f(0.2,0.2,0.2,0.5) + opengl.glDrawStringLeft("fps:%d" % (1 / renderTime)) self.SwapBuffers() except: errStr = 'An error has occurred during the 3D view drawing.' -- 2.30.2