diff options
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r-- | src/library_sdl.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index 32c93f67..24886713 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -166,11 +166,14 @@ mergeInto(LibraryManager.library, { {{{ makeSetValue('pixelFormat + SDL.structs.PixelFormat.Bmask', '0', '0xff', 'i32') }}} {{{ makeSetValue('pixelFormat + SDL.structs.PixelFormat.Amask', '0', '0xff', 'i32') }}} + // Decide if we want to use WebGL or not + var useWebGL = (flags & 0x04000000) != 0; // SDL_OPENGL + SDL.surfaces[surf] = { width: width, height: height, canvas: Module['canvas'], - ctx: Module['ctx2D'], + ctx: useWebGL ? Module['ctxGL'] : Module['ctx2D'], surf: surf, buffer: buffer, pixelFormat: pixelFormat, |