mirror of
https://github.com/azahar-emu/azahar
synced 2025-11-07 07:29:58 +01:00
* renderer_vulkan: remove out of context SDL_Quit call (fixes #1220) SDL_Quit must not be called unless the application must exit or SDL is no longer needed * comment: simplify, forgot init had ref-count
This commit is contained in:
parent
687c4415be
commit
fcdfe03674
@ -61,14 +61,16 @@ constexpr static std::array<vk::DescriptorSetLayoutBinding, 1> PRESENT_BINDINGS
|
|||||||
namespace {
|
namespace {
|
||||||
static bool IsLowRefreshRate() {
|
static bool IsLowRefreshRate() {
|
||||||
#ifdef ENABLE_SDL2
|
#ifdef ENABLE_SDL2
|
||||||
const auto sdl_init_status = SDL_Init(SDL_INIT_VIDEO);
|
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
|
||||||
if (sdl_init_status < 0) {
|
LOG_ERROR(Render_Vulkan, "SDL video failed to initialize, unable to check refresh rate");
|
||||||
LOG_ERROR(Render_Vulkan, "SDL failed to initialize, unable to check refresh rate");
|
return false;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
SDL_DisplayMode cur_display_mode;
|
SDL_DisplayMode cur_display_mode;
|
||||||
SDL_GetCurrentDisplayMode(0, &cur_display_mode); // TODO: Multimonitor handling. -OS
|
SDL_GetCurrentDisplayMode(0, &cur_display_mode); // TODO: Multimonitor handling. -OS
|
||||||
const auto cur_refresh_rate = cur_display_mode.refresh_rate;
|
const auto cur_refresh_rate = cur_display_mode.refresh_rate;
|
||||||
SDL_Quit();
|
|
||||||
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
|
|
||||||
if (cur_refresh_rate < SCREEN_REFRESH_RATE) {
|
if (cur_refresh_rate < SCREEN_REFRESH_RATE) {
|
||||||
LOG_WARNING(Render_Vulkan,
|
LOG_WARNING(Render_Vulkan,
|
||||||
@ -77,7 +79,6 @@ static bool IsLowRefreshRate() {
|
|||||||
cur_refresh_rate);
|
cur_refresh_rate);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user