1
0
mirror of https://github.com/libretro/RetroArch synced 2025-02-15 09:40:11 +00:00

(XDK - Xbox 1) Improve FPS logging

(PS3) Add FPS logging
This commit is contained in:
twinaphex 2012-11-14 21:51:56 +01:00
parent 46b958c7fa
commit fdcc5cb569
2 changed files with 22 additions and 12 deletions

@ -43,6 +43,10 @@
#include "shader_glsl.h"
#endif
#ifdef __CELLOS_LV2__
#define FPS_COUNTER
#endif
// Used for the last pass when rendering to the back buffer.
const GLfloat vertexes_flipped[] = {
0, 1,
@ -1086,6 +1090,10 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
#ifdef FPS_COUNTER
bool fps_enable = g_extern.console.rmenu.state.msg_fps.enable;
#endif
#ifdef HAVE_FBO
// Render to texture in first pass.
if (gl->fbo_inited)
@ -1141,6 +1149,15 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
#endif
gl_next_texture_index(gl, &tex_info);
#ifdef FPS_COUNTER
if(fps_enable)
{
static char fps_txt[128];
gfx_window_title(fps_txt, sizeof(fps_txt));
gl_render_msg_place(gl, g_settings.video.msg_pos_x, 0.56f, 1.04f, WHITE, fps_txt);
}
#endif
if (msg)
gl_render_msg(gl, msg);
@ -1278,6 +1295,7 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
#ifdef RARCH_CONSOLE
if (driver.video_data)
{
gl_t *gl = (gl_t*)driver.video_data;
// Reinitialize textures as we might have changed pixel formats.
gl_reinit_textures(gl, video);
return driver.video_data;

@ -779,22 +779,14 @@ static bool xdk_d3d_frame(void *data, const void *frame,
//Output memory usage
char buf[128], buf2[128], buf_fps_last[128];
static char fps_txt[128];
char buf[128];
bool ret = false;
snprintf(buf, sizeof(buf), "%.2f MB free / %.2f MB total", stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f));
xfonts_render_msg_place(d3d, font_x + 30, font_y + 50, 0 /* scale */, buf);
if(ret = gfx_window_title(buf2, sizeof(buf2)) || sizeof(buf_fps_last))
{
if(ret)
{
snprintf(buf_fps_last, sizeof(buf_fps_last), buf2);
xfonts_render_msg_place(d3d, font_x + 30, font_y + 70, 0 /* scale */, buf_fps_last);
convert_char_to_wchar(strw_buffer, buf2, sizeof(strw_buffer));
}
else if(buf_fps_last)
xfonts_render_msg_place(d3d, font_x + 30, font_y + 70, 0 /* scale */, buf2);
}
gfx_window_title(fps_txt, sizeof(fps_txt));
xfonts_render_msg_place(d3d, font_x + 30, font_y + 70, 0 /* scale */, fps_txt);
}
if (msg)