mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
Create video_driver_reinit
This commit is contained in:
parent
feacc56fff
commit
7e5d2321c5
25
command.c
25
command.c
@ -1933,28 +1933,15 @@ bool command_event(enum event_command cmd, void *data)
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_REINIT:
|
case CMD_EVENT_REINIT:
|
||||||
{
|
video_driver_reinit();
|
||||||
struct retro_hw_render_callback *hwr =
|
/* Poll input to avoid possibly stale data to corrupt things. */
|
||||||
video_driver_get_hw_context();
|
input_driver_poll();
|
||||||
|
|
||||||
if (hwr->cache_context)
|
|
||||||
video_driver_set_video_cache_context();
|
|
||||||
else
|
|
||||||
video_driver_unset_video_cache_context();
|
|
||||||
|
|
||||||
video_driver_unset_video_cache_context_ack();
|
|
||||||
command_event(CMD_EVENT_RESET_CONTEXT, NULL);
|
|
||||||
video_driver_unset_video_cache_context();
|
|
||||||
|
|
||||||
/* Poll input to avoid possibly stale data to corrupt things. */
|
|
||||||
input_driver_poll();
|
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_display_set_framebuffer_dirty_flag();
|
menu_display_set_framebuffer_dirty_flag();
|
||||||
if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
|
if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
|
||||||
command_event(CMD_EVENT_VIDEO_SET_BLOCKING_STATE, NULL);
|
command_event(CMD_EVENT_VIDEO_SET_BLOCKING_STATE, NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_CHEATS_DEINIT:
|
case CMD_EVENT_CHEATS_DEINIT:
|
||||||
cheat_manager_state_free();
|
cheat_manager_state_free();
|
||||||
|
@ -1784,6 +1784,21 @@ void video_driver_save_settings(config_file_t *conf)
|
|||||||
global->console.screen.flicker_filter_index);
|
global->console.screen.flicker_filter_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void video_driver_reinit(void)
|
||||||
|
{
|
||||||
|
struct retro_hw_render_callback *hwr =
|
||||||
|
video_driver_get_hw_context();
|
||||||
|
|
||||||
|
if (hwr->cache_context)
|
||||||
|
video_driver_cache_context = true;
|
||||||
|
else
|
||||||
|
video_driver_cache_context = false;
|
||||||
|
|
||||||
|
video_driver_cache_context_ack = false;
|
||||||
|
command_event(CMD_EVENT_RESET_CONTEXT, NULL);
|
||||||
|
video_driver_cache_context = false;
|
||||||
|
}
|
||||||
|
|
||||||
void video_driver_set_own_driver(void)
|
void video_driver_set_own_driver(void)
|
||||||
{
|
{
|
||||||
video_driver_data_own = true;
|
video_driver_data_own = true;
|
||||||
@ -1830,16 +1845,6 @@ void video_driver_set_context_negotiation_interface(
|
|||||||
hw_render_context_negotiation = iface;
|
hw_render_context_negotiation = iface;
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_driver_set_video_cache_context(void)
|
|
||||||
{
|
|
||||||
video_driver_cache_context = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_driver_unset_video_cache_context(void)
|
|
||||||
{
|
|
||||||
video_driver_cache_context = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool video_driver_is_video_cache_context(void)
|
bool video_driver_is_video_cache_context(void)
|
||||||
{
|
{
|
||||||
return video_driver_cache_context;
|
return video_driver_cache_context;
|
||||||
|
@ -262,11 +262,8 @@ const struct retro_hw_render_context_negotiation_interface
|
|||||||
*video_driver_get_context_negotiation_interface(void);
|
*video_driver_get_context_negotiation_interface(void);
|
||||||
void video_driver_set_context_negotiation_interface(const struct
|
void video_driver_set_context_negotiation_interface(const struct
|
||||||
retro_hw_render_context_negotiation_interface *iface);
|
retro_hw_render_context_negotiation_interface *iface);
|
||||||
void video_driver_set_video_cache_context(void);
|
|
||||||
void video_driver_unset_video_cache_context(void);
|
|
||||||
bool video_driver_is_video_cache_context(void);
|
bool video_driver_is_video_cache_context(void);
|
||||||
void video_driver_set_video_cache_context_ack(void);
|
void video_driver_set_video_cache_context_ack(void);
|
||||||
void video_driver_unset_video_cache_context_ack(void);
|
|
||||||
bool video_driver_is_video_cache_context_ack(void);
|
bool video_driver_is_video_cache_context_ack(void);
|
||||||
void video_driver_set_active(void);
|
void video_driver_set_active(void);
|
||||||
bool video_driver_is_active(void);
|
bool video_driver_is_active(void);
|
||||||
@ -369,6 +366,8 @@ void video_driver_get_size(unsigned *width, unsigned *height);
|
|||||||
|
|
||||||
void video_driver_set_size(unsigned *width, unsigned *height);
|
void video_driver_set_size(unsigned *width, unsigned *height);
|
||||||
|
|
||||||
|
void video_driver_unset_video_cache_context_ack(void);
|
||||||
|
|
||||||
float video_driver_get_aspect_ratio(void);
|
float video_driver_get_aspect_ratio(void);
|
||||||
|
|
||||||
void video_driver_set_aspect_ratio_value(float value);
|
void video_driver_set_aspect_ratio_value(float value);
|
||||||
@ -483,6 +482,8 @@ bool video_driver_texture_load(void *data,
|
|||||||
|
|
||||||
bool video_driver_texture_unload(uintptr_t *id);
|
bool video_driver_texture_unload(uintptr_t *id);
|
||||||
|
|
||||||
|
void video_driver_reinit(void);
|
||||||
|
|
||||||
extern video_driver_t video_gl;
|
extern video_driver_t video_gl;
|
||||||
extern video_driver_t video_vulkan;
|
extern video_driver_t video_vulkan;
|
||||||
extern video_driver_t video_psp1;
|
extern video_driver_t video_psp1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user