fix bad resolutions being picked in windowed mode (#1513)

fix bad resolutions being picked in windowed
This commit is contained in:
ManDude 2022-06-22 01:11:57 +01:00 committed by GitHub
parent 69a3007e9b
commit 8d8c6ccf39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -412,6 +412,7 @@ GfxDisplayMode GLDisplay::get_fullscreen() {
void GLDisplay::get_screen_size(int vmode_idx, s32* w_out, s32* h_out, s32* count_out) {
int count = 0;
auto vmode = glfwGetVideoMode(glfwGetPrimaryMonitor());
if (get_fullscreen() == GfxDisplayMode::Fullscreen) {
auto vmodes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count);
if (vmode_idx >= 0) {
vmode = &vmodes[vmode_idx];
@ -422,6 +423,7 @@ void GLDisplay::get_screen_size(int vmode_idx, s32* w_out, s32* h_out, s32* coun
}
}
}
}
if (count_out) {
*count_out = count;
}