Skip to content

Instantly share code, notes, and snippets.

@CharlieCrisp
Created April 15, 2021 18:33
Show Gist options
  • Select an option

  • Save CharlieCrisp/a38f620f270a114de4c418210138aa6d to your computer and use it in GitHub Desktop.

Select an option

Save CharlieCrisp/a38f620f270a114de4c418210138aa6d to your computer and use it in GitHub Desktop.
Example off how to set canvas size using emscripten + glfw
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