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

This commit is contained in:
Phoenix 2021-09-08 12:12:06 -04:00 committed by GitHub
parent ebdb341750
commit a859103836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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);