Commit 283089574032ffd39d41d85e5ac2d9a3d77cec5d

Eric Wasylishen 2022-06-08T23:49:05

testgles2.c: refresh cached SDL_GL_GetDrawableSize() on SDL_WINDOWEVENT_SIZE_CHANGED, not SDL_WINDOWEVENT_RESIZED Fixes bug with viewport not updating when moving window between monitors with different scale factors on Windows (this should also fix the same issue on other OS'es, though untested)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/test/testgles2.c b/test/testgles2.c
index c42835e..4b9e5d2 100644
--- a/test/testgles2.c
+++ b/test/testgles2.c
@@ -454,7 +454,7 @@ void loop()
         switch (event.type) {
         case SDL_WINDOWEVENT:
             switch (event.window.event) {
-                case SDL_WINDOWEVENT_RESIZED:
+                case SDL_WINDOWEVENT_SIZE_CHANGED:
                     for (i = 0; i < state->num_windows; ++i) {
                         if (event.window.windowID == SDL_GetWindowID(state->windows[i])) {
                             int w, h;