Use atomic_bool instead of atomic_flag for doresizes

atomic_flag seems to be broken on Windows for clearing them outside the
thread they were tested and set in
This commit is contained in:
Cacodemon345
2022-07-06 01:25:39 +06:00
parent 826a75292f
commit 20d3f0971c
6 changed files with 12 additions and 15 deletions

View File

@@ -291,11 +291,12 @@ int main(int argc, char* argv[]) {
/* If needed, handle a screen resize. */
for (int i = 0; i < MONITORS_NUM; i++) {
if (!monitors[i].target_buffer) continue;
if (!atomic_flag_test_and_set(&doresize_monitors[i]) && !video_fullscreen && !is_quit) {
if (atomic_load(&doresize_monitors[i]) == 1 && !video_fullscreen && !is_quit) {
if (vid_resize & 2)
plat_resize_monitor(fixed_size_x, fixed_size_y, i);
else
plat_resize_monitor(monitors[i].mon_scrnsz_x, monitors[i].mon_scrnsz_y, i);
atomic_store(&doresize_monitors[i], 0);
}
}