Ejemplo n.º 1
0
static void sdl2_poke_set_osd_msg(void *data, const char *msg,
      const void *params, void *font)
{
   sdl2_video_t *vid = (sdl2_video_t*)data;
   sdl2_render_msg(vid, msg);
   RARCH_LOG("[SDL]: OSD MSG: %s\n", msg);
}
Ejemplo n.º 2
0
static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
      unsigned height, uint64_t frame_count,
      unsigned pitch, const char *msg, video_frame_info_t *video_info)
{
   sdl2_video_t *vid = (sdl2_video_t*)data;
   char title[128];

   if (vid->should_resize)
      sdl_refresh_viewport(vid);

   if (frame && video_info->libretro_running)
   {
      static struct retro_perf_counter sdl_copy_frame = {0};

      SDL_RenderClear(vid->renderer);
      sdl_refresh_input_size(vid, false, vid->video.rgb32, width, height, pitch);

      performance_counter_init(sdl_copy_frame, "sdl_copy_frame");
      performance_counter_start_plus(video_info->is_perfcnt_enable, sdl_copy_frame);

      SDL_UpdateTexture(vid->frame.tex, NULL, frame, pitch);

      performance_counter_stop_plus(video_info->is_perfcnt_enable, sdl_copy_frame);
   }

   SDL_RenderCopyEx(vid->renderer, vid->frame.tex, NULL, NULL, vid->rotation, NULL, SDL_FLIP_NONE);

#ifdef HAVE_MENU
   menu_driver_frame(video_info);
#endif

   if (vid->menu.active)
      SDL_RenderCopy(vid->renderer, vid->menu.tex, NULL, NULL);

   if (msg)
      sdl2_render_msg(vid, msg);

   SDL_RenderPresent(vid->renderer);

   title[0] = '\0';

   video_driver_get_window_title(title, sizeof(title));

   if (title[0])
      SDL_SetWindowTitle(vid->window, title);

   return true;
}
Ejemplo n.º 3
0
static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
                           unsigned height, unsigned pitch, const char *msg)
{
   char buf[128];
   sdl2_video_t *vid = (sdl2_video_t*)data;
   runloop_t *runloop = rarch_main_get_ptr();
   driver_t *driver = driver_get_ptr();

   if (vid->should_resize)
      sdl_refresh_viewport(vid);

   if (frame)
   {
      sdl_refresh_input_size(vid, false, vid->video.rgb32, width, height, pitch);

      RARCH_PERFORMANCE_INIT(sdl_copy_frame);
      RARCH_PERFORMANCE_START(sdl_copy_frame);

      SDL_UpdateTexture(vid->frame.tex, NULL, frame, pitch);

      RARCH_PERFORMANCE_STOP(sdl_copy_frame);
   }

   SDL_RenderCopyEx(vid->renderer, vid->frame.tex, NULL, NULL, vid->rotation, NULL, SDL_FLIP_NONE);

#ifdef HAVE_MENU
   if (runloop->is_menu)
      menu_driver_frame();
#endif

   if (vid->menu.active)
      SDL_RenderCopy(vid->renderer, vid->menu.tex, NULL, NULL);

   if (msg)
      sdl2_render_msg(vid, msg);

   SDL_RenderPresent(vid->renderer);

   if (video_monitor_get_fps(buf, sizeof(buf), NULL, 0))
      SDL_SetWindowTitle(vid->window, buf);

   vid->frame_count++;

   return true;
}
Ejemplo n.º 4
0
void sdl2_poke_set_osd_msg(void *data, const char *msg, const struct font_params *params, void *font)
{
   sdl2_video_t *vid = (sdl2_video_t*)data;
   sdl2_render_msg(vid, msg);
   fprintf(stderr, "[SDL]: OSD MSG: %s\n", msg);
}