Skip to content

Commit

Permalink
Merge branch 'master' into v2.92d
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLR committed May 10, 2020
2 parents 7326965 + 3a757f1 commit f96a3a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/render_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ boolean sdl_set_video_mode(struct graphics_data *graphics, int width,

sdl_destruct_window(graphics);

#if defined(__EMSCRIPTEN__) && SDL_VERSION_ATLEAST(2,0,10)
// Also, a hint needs to be set to make SDL_UpdateWindowSurface not crash.
SDL_SetHint(SDL_HINT_EMSCRIPTEN_ASYNCIFY, "0");
#endif

render_data->window = SDL_CreateWindow("MegaZeux",
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height,
sdl_flags(depth, fullscreen, fullscreen_windowed, resize));
Expand Down
6 changes: 6 additions & 0 deletions src/render_softscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ static boolean softscale_set_video_mode(struct graphics_data *graphics,
else
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1");

#if defined(__EMSCRIPTEN__) && SDL_VERSION_ATLEAST(2,0,10)
// Not clear if this hint is required to make this renderer not crash, but
// considering both software and GLSL need it...
SDL_SetHint(SDL_HINT_EMSCRIPTEN_ASYNCIFY, "0");
#endif

render_data->sdl.window = SDL_CreateWindow("MegaZeux",
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height,
sdl_flags(depth, fullscreen, fullscreen_windowed, resize));
Expand Down

0 comments on commit f96a3a1

Please sign in to comment.