emscripten-core / emscripten-core/emscripten

SDL2 primitive shapes don't render when SDL_ttf text is rendered

Open
#16,223 0 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

**Version of emscripten/emsdk:**
```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.3 (c06156773675b2cb437e41459c12d44bd9a8f235)
clang version 14.0.0 (https://github.com/llvm/llvm-project d8f929a567083a6b90264193f1e4476f6b77c5fe)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /Users/tam/Developer/emsdk/upstream/bin
```

When text is rendered to the screen (via`TTF_RenderText_Blended`, `SDL_CreateTextureFromSurface`, and `SDL_RenderCopy`) all calls to SDL's primitive shapes (i.e. `SDL_RenderDrawRect`) no longer appear and the following warning is logged to the console:

```
WebGL warning: drawArraysInstanced: Vertex fetch requires 96, but attribs only supply 6.
```

This isn't an issue when building to a native platform, and has no impact on rendering textures from image surfaces.

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.