summaryrefslogtreecommitdiff
path: root/src/cRender.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cRender.cpp')
-rw-r--r--src/cRender.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cRender.cpp b/src/cRender.cpp
index ddc52df..818b11b 100644
--- a/src/cRender.cpp
+++ b/src/cRender.cpp
@@ -17,6 +17,7 @@ cRender::cRender(char _backound, WORD _color)
bMute = false;
bLockScreenSize = false;
+ bPrintDebugInfo = false;
#ifdef __linux__ //In Linux, setting Console size is not supported, so it gets Size of Console (Window) instead.
@@ -443,12 +444,15 @@ void cRender::setTargetFPS(unsigned int _fps)
void cRender::printDebugInfo()
{
+ if(!bPrintDebugInfo)
+ return;
+
char dbgtxt[30];
double lrt = (double)lastFrameTime / CLOCKS_PER_SEC;
- double fps = getFrametime()? 1/getFrametime():0;
+ double fps = getFrametime() ? 1/getFrametime() : 0;
- sprintf(dbgtxt, "R: %f F: %f", lrt, fps);
+ sprintf(dbgtxt, "R: %f F: %f ", lrt, fps);
drawText(dbgtxt, {0,0}, _COL_BLACK | _COL_WHITE_BG);
}
@@ -490,3 +494,8 @@ void cRender::mute(bool _mute)
{
bMute = _mute;
}
+
+void cRender::enableDebugInfo(bool _enable)
+{
+ bPrintDebugInfo = _enable;
+}