static void sdl2_poke_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha) { if (frame) { sdl2_video_t *vid = (sdl2_video_t*)data; sdl_refresh_input_size(vid, true, rgb32, width, height, width * (rgb32 ? 4 : 2)); SDL_UpdateTexture(vid->menu.tex, NULL, frame, vid->menu.pitch); } }
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; }
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; }
void sdl2_poke_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha) { sdl2_video_t *vid = (sdl2_video_t*)data; if (frame) { sdl_refresh_input_size(vid, true, rgb32, width, height, width * (rgb32 ? 4 : 2)); RARCH_PERFORMANCE_INIT(copy_texture_frame); RARCH_PERFORMANCE_START(copy_texture_frame); SDL_UpdateTexture(vid->menu.tex, NULL, frame, vid->menu.pitch); RARCH_PERFORMANCE_STOP(copy_texture_frame); } }