Created
April 15, 2021 18:33
-
-
Save CharlieCrisp/a38f620f270a114de4c418210138aa6d to your computer and use it in GitHub Desktop.
Example off how to set canvas size using emscripten + glfw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| glfwSetWindowSize( | |
| mWindow, | |
| width * device_pixel_ratio, | |
| height * device_pixel_ratio | |
| ); | |
| glViewport( | |
| 0, | |
| 0, | |
| width * device_pixel_ratio, | |
| height * device_pixel_ratio | |
| ); | |
| auto canvas_css_resize_result = emscripten_set_element_css_size( | |
| "canvas", | |
| width, | |
| height | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment