Example #1
0
void GSFrame::flip(draw_context_t)
{
	++m_frames;

	static Timer fps_t;

	if (fps_t.GetElapsedTimeInSec() >= 0.5)
	{
		std::string title = fmt::format("FPS: %.2f", (double)m_frames / fps_t.GetElapsedTimeInSec());

		if (!m_title_message.empty())
			title += " | " + m_title_message;

		if (!Emu.GetTitle().empty())
			title += " | " + Emu.GetTitle();

		if (!Emu.GetTitleID().empty())
			title += " | [" + Emu.GetTitleID() + "]";

		// can freeze on exit
		SetTitle(wxString(title.c_str(), wxConvUTF8));
		m_frames = 0;
		fps_t.Start();
	}
}
Example #2
0
void GLGSFrame::Flip()
{
	if(!canvas) return;
	canvas->SetCurrent();

	static Timer fps_t;
	canvas->SwapBuffers();
	m_frames++;

	if(fps_t.GetElapsedTimeInSec() >= 0.5)
	{
		SetTitle(wxString::Format("FPS: %.2f", (double)m_frames / fps_t.GetElapsedTimeInSec()));
		m_frames = 0;
		fps_t.Start();
	}
}
Example #3
0
void GLGSFrame::Flip(void* context)
{
	if (!canvas) return;
	canvas->SetCurrent(*(wxGLContext*)context);

	static Timer fps_t;
	canvas->SwapBuffers();
	m_frames++;

	const std::string sub_title = Emu.GetTitle() + (Emu.GetTitleID().length() ? " [" + Emu.GetTitleID() + "] | " : " | ");

	if (fps_t.GetElapsedTimeInSec() >= 0.5)
	{
		// can freeze on exit
		SetTitle(wxString(sub_title.c_str(), wxConvUTF8) + wxString::Format("FPS: %.2f", (double)m_frames / fps_t.GetElapsedTimeInSec()));
		m_frames = 0;
		fps_t.Start();
	}
}