Exemplo n.º 1
0
bool take_screenshot(const char *name_base, bool silence, bool has_valid_framebuffer)
{
   bool is_paused         = false;
   bool is_idle           = false;
   bool is_slowmotion     = false;
   bool is_perfcnt_enable = false;
   bool ret               = false;

   runloop_get_status(&is_paused, &is_idle, &is_slowmotion, &is_perfcnt_enable);

   ret       = take_screenshot_choice(name_base, silence, is_paused, is_idle,
         has_valid_framebuffer);

   if (is_paused && !is_idle)
         video_driver_cached_frame();

   return ret;
}
Exemplo n.º 2
0
/**
 * take_screenshot:
 *
 * Returns: true (1) if successful, otherwise false (0).
 **/
bool take_screenshot(void)
{
   global_t *global           = global_get_ptr();
   char *name_base            = strdup(global->name.base);
   bool            is_paused  = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL);
   bool             ret       = take_screenshot_choice(name_base);
   const char *msg_screenshot = ret 
      ? msg_hash_to_str(MSG_TAKING_SCREENSHOT)  :
        msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT);
   const char *msg            = msg_screenshot;

   free(name_base);

   runloop_msg_queue_push(msg, 1, is_paused ? 1 : 180, true);

   if (is_paused)
      video_driver_cached_frame_render();

   return ret;
}