mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 06:40:18 +00:00
Add RARCH_DISPLAY_CTL_{DEINIT/INIT}
This commit is contained in:
parent
c1fa9dc637
commit
21cabec759
4
driver.c
4
driver.c
@ -384,7 +384,7 @@ void init_drivers(int flags)
|
||||
|
||||
video_monitor_reset();
|
||||
|
||||
init_video();
|
||||
video_driver_ctl(RARCH_DISPLAY_CTL_INIT, NULL);
|
||||
|
||||
if (!driver->video_cache_context_ack
|
||||
&& hw_render->context_reset)
|
||||
@ -464,7 +464,7 @@ void uninit_drivers(int flags)
|
||||
uninit_audio();
|
||||
|
||||
if (flags & DRIVERS_VIDEO_INPUT)
|
||||
uninit_video_input();
|
||||
video_driver_ctl(RARCH_DISPLAY_CTL_DEINIT, NULL);
|
||||
|
||||
if (flags & DRIVER_VIDEO)
|
||||
{
|
||||
|
@ -399,7 +399,7 @@ static void video_driver_unset_callback(void)
|
||||
hw_render = NULL;
|
||||
}
|
||||
|
||||
void uninit_video_input(void)
|
||||
static bool uninit_video_input(void)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
||||
@ -425,9 +425,11 @@ void uninit_video_input(void)
|
||||
video_driver_unset_callback();
|
||||
event_command(EVENT_CMD_SHADER_DIR_DEINIT);
|
||||
video_monitor_compute_fps_statistics();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool init_video(void)
|
||||
static bool init_video(void)
|
||||
{
|
||||
unsigned max_dim, scale, width, height;
|
||||
video_viewport_t *custom_vp = NULL;
|
||||
@ -1148,6 +1150,10 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_DISPLAY_CTL_INIT:
|
||||
return init_video();
|
||||
case RARCH_DISPLAY_CTL_DEINIT:
|
||||
return uninit_video_input();
|
||||
case RARCH_DISPLAY_CTL_SET_ASPECT_RATIO:
|
||||
if (!poke || !poke->set_aspect_ratio)
|
||||
return false;
|
||||
|
@ -221,6 +221,8 @@ enum rarch_display_type
|
||||
enum rarch_display_ctl_state
|
||||
{
|
||||
RARCH_DISPLAY_CTL_NONE = 0,
|
||||
RARCH_DISPLAY_CTL_INIT,
|
||||
RARCH_DISPLAY_CTL_DEINIT,
|
||||
RARCH_DISPLAY_CTL_APPLY_STATE_CHANGES,
|
||||
RARCH_DISPLAY_CTL_FIND_DRIVER,
|
||||
RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE,
|
||||
@ -291,10 +293,6 @@ retro_proc_address_t video_driver_get_proc_address(const char *sym);
|
||||
bool video_driver_set_shader(enum rarch_shader_type type,
|
||||
const char *shader);
|
||||
|
||||
void uninit_video_input(void);
|
||||
|
||||
bool init_video(void);
|
||||
|
||||
bool video_driver_set_rotation(unsigned rotation);
|
||||
|
||||
void video_driver_set_video_mode(unsigned width,
|
||||
|
Loading…
x
Reference in New Issue
Block a user