mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
emscripten: compensate canvas size for device pixel ratio
This commit is contained in:
parent
a112e5de0d
commit
1ff0d6ddac
1 changed files with 5 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue