emscripten-core / emscripten-core/emscripten

SDL.surfaces.ctx has no save function

Open
#15,934 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Please include the following in your bug report:

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.1-git (e325125379a98b0bc2988a6de8ad7f54191ade34)
clang version 14.0.0 (https://github.com/llvm/llvm-project 1a929525e86a20d0b3455a400d0dbed40b325a13)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /Users/pro21/emsdk/upstream/bin

**Failing command line in full:**
no failing command line

**Full link command and output with `-v` appended:**
no failing command line

when i run the sdl test ,say "sdl_canvas.c", I run this command :
```
./emcc tests/sdl_canvas.c -s USE_FREETYPE=1 -s FETCH=1 --proxy-to-worker -o hello.html

```
and i get this error from the browser' console when i open hello.html:
```
hello.js:5850 Uncaught TypeError: surfData.ctx.save is not a function
at _SDL_FillRect (hello.js:5850)
at 00018492:0x684
at hello.js:1551
at callMain (hello.js:8708)
at doRun (hello.js:8765)
at hello.js:8776
```
this is the screen snapshot,
![image](https://user-images.githubusercontent.com/35994794/148741645-fff38b01-ba54-401d-a5af-b1ef79c561af.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.