Selaa lähdekoodia

Fix canvas example not rendering fully on macOS (#288)

Phoenix 4 vuotta sitten
vanhempi
commit
a859103836
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      example/canvas.c

+ 4 - 1
example/canvas.c

@@ -477,7 +477,10 @@ int main(int argc, char *argv[])
         canvas_end(&ctx, &canvas);}
 
         /* Draw */
-        glfwGetWindowSize(win, &width, &height);
+        /* Framebuffer size is used instead of window size because the window size is in screen coordinates instead of pixels.
+         * See https://www.glfw.org/docs/latest/window_guide.html#window_size for more info
+         */
+        glfwGetFramebufferSize(win, &width, &height);
         glViewport(0, 0, width, height);
         glClear(GL_COLOR_BUFFER_BIT);
         glClearColor(0.2f, 0.2f, 0.2f, 1.0f);