@@ -433,12 +433,11 @@ In this case, it is a WebGL context created using the Emscripten call `emscripte
433
433
This implementation supports the window hints: `GLFW_CONTEXT_VERSION_MAJOR` and
434
434
`GLFW_CONTEXT_VERSION_MINOR`.
435
435
436
- > [!CAUTION]
437
- > At this moment, the Emscripten implementation ignores the major version unless the `-sMAX_WEBGL_VERSION=2` compiler
438
- > flag is provided
439
- > * No flag => WebGL 1.0 regardless of `GLFW_CONTEXT_VERSION_MAJOR`
440
- > * `-sMIN_WEBGL_VERSION=2` => WebGL 2.0 regardless of `GLFW_CONTEXT_VERSION_MAJOR`
441
- > * `-sMAX_WEBGL_VERSION=2` => WebGL 1.0 or 2.0 depending on value of `GLFW_CONTEXT_VERSION_MAJOR`
436
+ > [!TIP]
437
+ > Since Emscripten 4.0.1, when using the port, it automatically sets the Emscripten linker
438
+ > flag `-sMAX_WEBGL_VERSION=2` to enable choosing the OpenGL version via the
439
+ > `GLFW_CONTEXT_VERSION_MAJOR` window hint.
440
+ > Prior to Emscripten 4.0.1, you have to manually set it.
442
441
443
442
In addition, by default, the context created is set with `premultipliedAlpha=true`.
444
443
@@ -550,7 +549,7 @@ As of initial release, I ran the following experiment on both implementations us
550
549
551
550
## Implementation size (update)
552
551
553
- ![ emscripten - 3.1.74 ] ( https://img.shields.io/badge/emscripten-3.1.74 -blue )
552
+ ![ emscripten - 4.0.1 ] ( https://img.shields.io/badge/emscripten-4.0.1 -blue )
554
553
![ emscripten-glfw-3.4.0.20250112] ( https://img.shields.io/badge/emscripten--glfw-3.4.0.20250112-blue )
555
554
556
555
``` text
@@ -563,10 +562,10 @@ As of initial release, I ran the following experiment on both implementations us
563
562
> emcc --use-port=contrib.glfw3:disableWarning=true:disableJoystick=true:disableMultiWindow=true main.cpp -O2 -o /tmp/build/index.html
564
563
```
565
564
566
- | Mode | ` library_glfw.js ` | This implementation | Delta |
567
- | -------------------| ---------------------------------------- | ------------------------------------------ | -------|
568
- | Release | js: 103917 , wasm: 13904 , total: 117821 | js: 58854 , wasm: 73832 , total: 132686 | 1.13x |
569
- | Release (minimal) | - | js: 56630 , wasm: 66486 , total: 123116 | 1.04x |
565
+ | Mode | ` library_glfw.js ` | This implementation | Delta |
566
+ | -------------------| ---------------------------------------| --------------------------------------| - -------|
567
+ | Release | js:103492 , wasm:13831 , total:117323 | js:59906 , wasm:73001 , total:132907 | 13.28% |
568
+ | Release (minimal) | - | js:57682 , wasm:65877 , total:123559 | 5.31% |
570
569
571
570
> [ !NOTE]
572
571
> The good news is that Emscripten is improving and this implementation is benefitting from it.
0 commit comments