From 1b6565fcb7e80209b5da56cb9e004d52003185e1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 13 Sep 2016 00:03:59 -0700 Subject: [PATCH] use Module.createContext for 2D rendering in emscripten --- src/video/emscripten/SDL_emscriptenframebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c index da03497bb..8a6a465d9 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.c +++ b/src/video/emscripten/SDL_emscriptenframebuffer.c @@ -76,7 +76,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec if (!Module['SDL2']) Module['SDL2'] = {}; var SDL2 = Module['SDL2']; if (SDL2.ctxCanvas !== Module['canvas']) { - SDL2.ctx = Module['canvas'].getContext('2d'); + SDL2.ctx = Module['createContext'](Module['canvas'], false, true); SDL2.ctxCanvas = Module['canvas']; } if (SDL2.w !== w || SDL2.h !== h || SDL2.imageCtx !== SDL2.ctx) {