use Module.createContext for 2D rendering in emscripten

This commit is contained in:
Alon Zakai 2016-09-13 00:03:59 -07:00
parent bec5573476
commit 1b6565fcb7
1 changed files with 1 additions and 1 deletions

View File

@ -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) {