mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-18 00:18:22 +00:00
Merge pull request #8134 from bparker06/gdi_fallback
win32: force video driver to gdi if no accelerated graphics driver is found
This commit is contained in:
commit
0a068ef871
@ -1789,6 +1789,12 @@ static void *gl_init(const video_info_t *video,
|
||||
if (!string_is_empty(version))
|
||||
sscanf(version, "%d.%d", &gl->version_major, &gl->version_minor);
|
||||
|
||||
#ifdef _WIN32
|
||||
if (string_is_equal(vendor, "Microsoft Corporation"))
|
||||
if (string_is_equal(renderer, "GDI Generic"))
|
||||
rarch_force_video_driver_fallback("gdi");
|
||||
#endif
|
||||
|
||||
hwr = video_driver_get_hw_context();
|
||||
|
||||
if (hwr->context_type == RETRO_HW_CONTEXT_OPENGL_CORE)
|
||||
|
@ -8112,3 +8112,7 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DOWN_SELECT,
|
||||
"Down + Select"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER_FALLBACK,
|
||||
"Your graphics driver is not compatible with the current video driver in RetroArch, falling back to the %s driver. Please restart RetroArch for the changes to take effect."
|
||||
)
|
||||
|
@ -2229,7 +2229,7 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_VALUE_SWITCH_BACKLIGHT_CONTROL,
|
||||
MENU_ENUM_SUBLABEL_SWITCH_BACKLIGHT_CONTROL,
|
||||
#endif
|
||||
#if defined(HAVE_LAKKA_SWITCH) || defined(HAVE_LIBNX)
|
||||
#if defined(HAVE_LAKKA_SWITCH) || defined(HAVE_LIBNX)
|
||||
MENU_ENUM_LABEL_SWITCH_CPU_PROFILE,
|
||||
MENU_ENUM_LABEL_VALUE_SWITCH_CPU_PROFILE,
|
||||
MENU_ENUM_SUBLABEL_SWITCH_CPU_PROFILE,
|
||||
@ -2243,6 +2243,7 @@ enum msg_hash_enums
|
||||
MENU_LABEL(MENU_SOUND_CANCEL),
|
||||
MENU_LABEL(MENU_SOUND_NOTICE),
|
||||
MENU_LABEL(MENU_SOUND_BGM),
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER_FALLBACK,
|
||||
|
||||
MSG_LAST
|
||||
};
|
||||
|
36
retroarch.c
36
retroarch.c
@ -3769,3 +3769,39 @@ char *get_retroarch_launch_arguments(void)
|
||||
{
|
||||
return launch_arguments;
|
||||
}
|
||||
|
||||
void rarch_force_video_driver_fallback(const char *driver)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
ui_msg_window_t *msg_window = NULL;
|
||||
|
||||
strlcpy(settings->arrays.video_driver, driver, sizeof(settings->arrays.video_driver));
|
||||
|
||||
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* UI companion driver is not inited yet, just call into it directly */
|
||||
msg_window = &ui_msg_window_win32;
|
||||
#endif
|
||||
|
||||
if (msg_window)
|
||||
{
|
||||
ui_msg_window_state window_state = {0};
|
||||
char *title = strdup(msg_hash_to_str(MSG_ERROR));
|
||||
char text[PATH_MAX_LENGTH];
|
||||
|
||||
text[0] = '\0';
|
||||
|
||||
snprintf(text, sizeof(text), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER_FALLBACK), driver);
|
||||
|
||||
window_state.buttons = UI_MSG_WINDOW_OK;
|
||||
window_state.title = title;
|
||||
window_state.text = strdup(text);
|
||||
|
||||
msg_window->error(&window_state);
|
||||
|
||||
free(title);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
@ -404,6 +404,8 @@ void runloop_msg_queue_lock(void);
|
||||
void runloop_msg_queue_unlock(void);
|
||||
#endif
|
||||
|
||||
void rarch_force_video_driver_fallback(const char *driver);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user