diff --git a/console/rmenu/rmenu.c b/console/rmenu/rmenu.c index c883d8accc..a02806f3b0 100644 --- a/console/rmenu/rmenu.c +++ b/console/rmenu/rmenu.c @@ -1033,13 +1033,13 @@ static void set_setting_action(void *data, unsigned switchvalue, uint64_t input) if(gfx_ctx_check_resolution(CELL_VIDEO_OUT_RESOLUTION_576)) { //ps3graphics_set_pal60hz(Settings.PS3PALTemporalMode60Hz); - video_ptr.restart(); + driver.video->restart(); } } else { //ps3graphics_set_pal60hz(0); - video_ptr.restart(); + driver.video->restart(); } } break; @@ -1275,7 +1275,7 @@ static void set_setting_action(void *data, unsigned switchvalue, uint64_t input) if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B))) { rarch_settings_change(S_TRIPLE_BUFFERING); - video_ptr.restart(); + driver.video->restart(); } if(input & (1ULL << RMENU_DEVICE_NAV_START)) { @@ -1283,7 +1283,7 @@ static void set_setting_action(void *data, unsigned switchvalue, uint64_t input) rarch_settings_default(S_DEF_TRIPLE_BUFFERING); if(!old_buffer_input) - video_ptr.restart(); + driver.video->restart(); } break; case SETTING_ENABLE_SCREENSHOTS: @@ -2112,19 +2112,19 @@ int ingame_menu(void *data, void *state) if(input & (1ULL << RMENU_DEVICE_NAV_LEFT)) { rarch_settings_change(S_ROTATION_DECREMENT); - video_ptr.set_rotation(NULL, g_extern.console.screen.orientation); + driver.video->set_rotation(NULL, g_extern.console.screen.orientation); } if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B))) { rarch_settings_change(S_ROTATION_INCREMENT); - video_ptr.set_rotation(NULL, g_extern.console.screen.orientation); + driver.video->set_rotation(NULL, g_extern.console.screen.orientation); } if(input & (1ULL << RMENU_DEVICE_NAV_START)) { rarch_settings_default(S_DEF_ROTATION); - video_ptr.set_rotation(NULL, g_extern.console.screen.orientation); + driver.video->set_rotation(NULL, g_extern.console.screen.orientation); } snprintf(strw_buffer, sizeof(strw_buffer), "Press [%s] to reset back to default values.", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_START)); break; diff --git a/console/rmenu/rmenu.h b/console/rmenu/rmenu.h index 73d25d7d51..472e00ad22 100644 --- a/console/rmenu/rmenu.h +++ b/console/rmenu/rmenu.h @@ -19,7 +19,6 @@ #if defined(HAVE_OPENGL) #define DEVICE_CAST gl_t* -#define video_ptr video_gl #endif #if defined(__CELLOS_LV2__) @@ -29,9 +28,6 @@ #elif defined(_XBOX1) #define DEVICE_CAST xdk_d3d_video_t* #define input_ptr input_xinput -#define video_ptr video_xdk_d3d - - #endif typedef struct diff --git a/driver.c b/driver.c index 98afab31bb..d318548d9a 100644 --- a/driver.c +++ b/driver.c @@ -169,7 +169,7 @@ static void find_audio_driver(void) rarch_fail(1, "find_audio_driver()"); } -static void find_video_driver(void) +void find_video_driver(void) { for (unsigned i = 0; i < ARRAY_SIZE(video_drivers); i++) { diff --git a/driver.h b/driver.h index 81b93732a8..090601ddb8 100644 --- a/driver.h +++ b/driver.h @@ -319,6 +319,8 @@ void init_drivers(void); void init_drivers_pre(void); void uninit_drivers(void); +void find_video_driver(void); + void init_video_input(void); void uninit_video_input(void); void init_audio(void); diff --git a/frontend/frontend_gx.c b/frontend/frontend_gx.c index 54e71eb929..5109943914 100644 --- a/frontend/frontend_gx.c +++ b/frontend/frontend_gx.c @@ -278,7 +278,7 @@ static bool rmenu_iterate(void) static bool first_held = false; g_extern.draw_menu = true; - video_gx.apply_state_changes(); + driver.video->apply_state_changes(); g_extern.frame_count++; @@ -501,8 +501,8 @@ int main(int argc, char *argv[]) config_set_defaults(); input_gx.init(); - video_gx.start(); - driver.video = &video_gx; + find_video_driver(); + driver.video->start(); gx_video_t *gx = (gx_video_t*)driver.video_data; gx->menu_data = (uint32_t *) menu_framebuf; @@ -607,8 +607,7 @@ begin_shutdown: rarch_main_deinit(); input_gx.free(NULL); - - video_gx.stop(); + driver.video->stop(); menu_free(); #ifdef HAVE_LOGGER diff --git a/frontend/frontend_ps3.c b/frontend/frontend_ps3.c index d808644239..6f739693e8 100644 --- a/frontend/frontend_ps3.c +++ b/frontend/frontend_ps3.c @@ -319,8 +319,8 @@ int main(int argc, char *argv[]) #endif #endif - video_gl.start(); - driver.video = &video_gl; + find_video_driver(); + driver.video->start(); #ifdef HAVE_OSKUTIL oskutil_params *osk = &g_extern.console.misc.oskutil_handle; @@ -387,7 +387,7 @@ begin_shutdown: rarch_main_deinit(); input_ps3.free(NULL); - video_gl.stop(); + driver.video->stop(); menu_free(); #ifdef HAVE_OSKUTIL diff --git a/frontend/frontend_psp.c b/frontend/frontend_psp.c index 1c060af866..739a4328cd 100644 --- a/frontend/frontend_psp.c +++ b/frontend/frontend_psp.c @@ -159,8 +159,8 @@ int main(int argc, char *argv[]) input_psp.post_init(); - video_psp1.start(); - driver.video = &video_psp1; + find_video_driver(); + driver.video->start(); menu_init(); @@ -207,7 +207,7 @@ begin_shutdown: rarch_main_deinit(); input_psp.free(NULL); - video_psp1.stop(); + driver.video->stop(); menu_free(); g_extern.verbose = false; diff --git a/frontend/frontend_xdk.c b/frontend/frontend_xdk.c index ae3827745d..f5e8aa2f28 100644 --- a/frontend/frontend_xdk.c +++ b/frontend/frontend_xdk.c @@ -175,13 +175,8 @@ int main(int argc, char *argv[]) input_xinput.post_init(); -#if defined(HAVE_D3D9) || defined(HAVE_D3D8) - video_xdk_d3d.start(); - driver.video = &video_xdk_d3d; -#else - video_null.start(); - driver.video = &video_null; -#endif + find_video_driver(); + driver.video->start(); system_init(); @@ -229,11 +224,7 @@ begin_shutdown: config_save_file(g_extern.config_path); menu_free(); -#if defined(HAVE_D3D8) || defined(HAVE_D3D9) - video_xdk_d3d.stop(); -#else - video_null.stop(); -#endif + driver.video->stop(); input_xinput.free(NULL); if(g_extern.console.external_launch.enable)