Skip to content

Commit 1da84fa

Browse files
committed
Emscripten 4.0.1 released
1 parent 88644f5 commit 1da84fa

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

.github/workflows/compute_size_manual.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
js_size=$(stat --format="%s" build-with-library_glfw/index.js)
3939
wasm_size=$(stat --format="%s" build-with-library_glfw/index.wasm)
4040
total_size=$((js_size + wasm_size))
41-
echo "js:$js_size, wasm:$wasm_size, total: $total_size"
41+
echo "js:$js_size, wasm:$wasm_size, total:$total_size"
4242
echo "TOTAL_SIZE_LIBRARY_GLFW=$total_size" >> $GITHUB_ENV
4343
4444
- name: Compiling with contrib.glfw3
@@ -53,7 +53,7 @@ jobs:
5353
wasm_size=$(stat --format="%s" build-with-port/index.wasm)
5454
total_size=$((js_size + wasm_size))
5555
delta=$(echo "scale=10; d=($total_size / $TOTAL_SIZE_LIBRARY_GLFW - 1) * 100; scale=2; d/1" | bc)
56-
echo "js:$js_size, wasm:$wasm_size, total: $total_size | ${delta}%"
56+
echo "js:$js_size, wasm:$wasm_size, total:$total_size | ${delta}%"
5757
5858
- name: Compiling with contrib.glfw3 (small)
5959
working-directory: ${{github.workspace}}/emscripten-glfw
@@ -67,4 +67,4 @@ jobs:
6767
wasm_size=$(stat --format="%s" build-with-port-small/index.wasm)
6868
total_size=$((js_size + wasm_size))
6969
delta=$(echo "scale=10; d=($total_size / $TOTAL_SIZE_LIBRARY_GLFW - 1) * 100; scale=2; d/1" | bc)
70-
echo "js:$js_size, wasm:$wasm_size, total: $total_size | ${delta}%"
70+
echo "js:$js_size, wasm:$wasm_size, total:$total_size | ${delta}%"

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Introduction
44
This project is an Emscripten port of GLFW written in C++ for the web/wasm platform. The currently supported
55
GLFW API is 3.4.
66

7-
[![emscripten - TBD](https://img.shields.io/badge/emscripten-TBD-blue)](https://emscripten.org)
7+
[![emscripten - 4.0.1](https://img.shields.io/badge/emscripten-4.0.1-blue)](https://emscripten.org)
88
[![contrib.glfw3 - 3.4.0.20250112](https://img.shields.io/badge/contrib.glfw3-3.4.0.20250112-blue)](https://github.com/pongasoft/emscripten-glfw/releases/latest)
99
[![GLFW - 3.4.0](https://img.shields.io/badge/GLFW-3.4.0-blue)](https://www.glfw.org/)
1010
[![License](https://img.shields.io/badge/License-Apache%20License%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
@@ -212,7 +212,7 @@ emcc --use-port=contrib.glfw3:disableWarning=true:disableMultiWindow=true main.c
212212
> #### Note about availability in Emscripten
213213
> | Emscripten | this port |
214214
> |------------|----------------|
215-
> | TBD | 3.4.0.20250112 |
215+
> | 4.0.1 | 3.4.0.20250112 |
216216
> | 4.0.0 | 3.4.0.20241230 |
217217
> | 3.1.69 | 3.4.0.20241004 |
218218
> | 3.1.66 | 3.4.0.20240907 |
@@ -250,10 +250,11 @@ Check the [Building](docs/Building.md) page for details on how to build this pro
250250
251251
Release Notes
252252
-------------
253-
#### 3.4.0.20250112 - 2025-01-12 | Emscripten TBD
253+
#### 3.4.0.20250112 - 2025-01-12 | Emscripten 4.0.1
254254
255255
- Added support for `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
256256
- Re-enable GL extensions by default (regression introduced in 3.4.0.20241230). Fixes #13.
257+
- Changed port to automatically set the proper Emscripten flags to enable `GLFW_CONTEXT_VERSION_MAJOR`. Fixes #14.
257258
258259
#### 3.4.0.20241230 - 2024-12-30 | 4.0.0
259260

docs/Usage.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,11 @@ In this case, it is a WebGL context created using the Emscripten call `emscripte
433433
This implementation supports the window hints: `GLFW_CONTEXT_VERSION_MAJOR` and
434434
`GLFW_CONTEXT_VERSION_MINOR`.
435435
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.
442441
443442
In addition, by default, the context created is set with `premultipliedAlpha=true`.
444443
@@ -550,7 +549,7 @@ As of initial release, I ran the following experiment on both implementations us
550549
551550
## Implementation size (update)
552551
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)
554553
![emscripten-glfw-3.4.0.20250112](https://img.shields.io/badge/emscripten--glfw-3.4.0.20250112-blue)
555554
556555
```text
@@ -563,10 +562,10 @@ As of initial release, I ran the following experiment on both implementations us
563562
> emcc --use-port=contrib.glfw3:disableWarning=true:disableJoystick=true:disableMultiWindow=true main.cpp -O2 -o /tmp/build/index.html
564563
```
565564
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% |
570569
571570
> [!NOTE]
572571
> The good news is that Emscripten is improving and this implementation is benefitting from it.

0 commit comments

Comments
 (0)