emscripten: compensate canvas size for device pixel ratio

This commit is contained in:
Sebastian Krzyszkowiak 2019-10-17 03:50:48 +02:00
parent a112e5de0d
commit 1ff0d6ddac
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -246,6 +246,11 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
al_set_new_window_title(game->_priv.params.window_title ? game->_priv.params.window_title : al_get_app_name());
#ifdef __EMSCRIPTEN__
game->config.width *= emscripten_get_device_pixel_ratio();
game->config.height *= emscripten_get_device_pixel_ratio();
#endif
game->display = al_create_display(game->config.width, game->config.height);
if (!game->display) {
fprintf(stderr, "Failed to create display!\n");