summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2014-12-20 12:14:33 +0100
committerdegasus <wickmarkus@web.de>2014-12-20 12:25:10 +0100
commitffa014dd4853d231e3b380e12ccc96318e184f64 (patch)
treed99b0b60ea4e149137b640ecdda23ea5dd3ea015 /Source/Core/VideoCommon/RenderBase.cpp
parenta560d8f1502657b098cef342c50a84bd3996852e (diff)
VideoCommon: merge debug info generators
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 84c037c753..d287485da6 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -12,16 +12,19 @@
// Next frame, that one is scanned out and the other one gets the copy. = double buffering.
// ---------------------------------------------------------------------------------------------
+#include <cinttypes>
#include <cmath>
#include <string>
#include "Common/Atomic.h"
+#include "Common/Profiler.h"
#include "Common/StringUtil.h"
#include "Common/Timer.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/Host.h"
+#include "Core/Movie.h"
#include "Core/FifoPlayer/FifoRecorder.h"
#include "VideoCommon/AVIDump.h"
@@ -388,6 +391,47 @@ void Renderer::DrawDebugText()
g_renderer->RenderText(final_yellow, 20, 20, 0xFFFFFF00);
}
+std::string Renderer::GetDebugText()
+{
+ // Draw various messages on the screen, like FPS, statistics, etc.
+ std::string debug_info;
+
+ if (g_ActiveConfig.bShowFPS || SConfig::GetInstance().m_ShowFrameCount)
+ {
+ std::string fps = "";
+ if (g_ActiveConfig.bShowFPS)
+ debug_info += StringFromFormat("FPS: %d", g_renderer->m_fps_counter.m_fps);
+
+ if (g_ActiveConfig.bShowFPS && SConfig::GetInstance().m_ShowFrameCount)
+ debug_info += " - ";
+ if (SConfig::GetInstance().m_ShowFrameCount)
+ {
+ debug_info += StringFromFormat("Frame: %llu", (unsigned long long) Movie::g_currentFrame);
+ if (Movie::IsPlayingInput())
+ debug_info += StringFromFormat(" / %llu", (unsigned long long) Movie::g_totalFrames);
+ }
+
+ debug_info += "\n";
+ }
+
+ if (SConfig::GetInstance().m_ShowLag)
+ debug_info += StringFromFormat("Lag: %" PRIu64 "\n", Movie::g_currentLagCount);
+
+ if (SConfig::GetInstance().m_ShowInputDisplay)
+ debug_info += Movie::GetInputDisplay();
+
+ debug_info += Profiler::ToString();
+
+
+ if (g_ActiveConfig.bOverlayStats)
+ debug_info += Statistics::ToString();
+
+ if (g_ActiveConfig.bOverlayProjStats)
+ debug_info += Statistics::ToStringProj();
+
+ return debug_info;
+}
+
void Renderer::UpdateDrawRectangle(int backbuffer_width, int backbuffer_height)
{
float FloatGLWidth = (float)backbuffer_width;