Skip to content

Commit

Permalink
Emscripten 4.0.1 released
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Jan 17, 2025
1 parent 88644f5 commit 1da84fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/compute_size_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
js_size=$(stat --format="%s" build-with-library_glfw/index.js)
wasm_size=$(stat --format="%s" build-with-library_glfw/index.wasm)
total_size=$((js_size + wasm_size))
echo "js:$js_size, wasm:$wasm_size, total: $total_size"
echo "js:$js_size, wasm:$wasm_size, total:$total_size"
echo "TOTAL_SIZE_LIBRARY_GLFW=$total_size" >> $GITHUB_ENV
- name: Compiling with contrib.glfw3
Expand All @@ -53,7 +53,7 @@ jobs:
wasm_size=$(stat --format="%s" build-with-port/index.wasm)
total_size=$((js_size + wasm_size))
delta=$(echo "scale=10; d=($total_size / $TOTAL_SIZE_LIBRARY_GLFW - 1) * 100; scale=2; d/1" | bc)
echo "js:$js_size, wasm:$wasm_size, total: $total_size | ${delta}%"
echo "js:$js_size, wasm:$wasm_size, total:$total_size | ${delta}%"
- name: Compiling with contrib.glfw3 (small)
working-directory: ${{github.workspace}}/emscripten-glfw
Expand All @@ -67,4 +67,4 @@ jobs:
wasm_size=$(stat --format="%s" build-with-port-small/index.wasm)
total_size=$((js_size + wasm_size))
delta=$(echo "scale=10; d=($total_size / $TOTAL_SIZE_LIBRARY_GLFW - 1) * 100; scale=2; d/1" | bc)
echo "js:$js_size, wasm:$wasm_size, total: $total_size | ${delta}%"
echo "js:$js_size, wasm:$wasm_size, total:$total_size | ${delta}%"
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Introduction
This project is an Emscripten port of GLFW written in C++ for the web/wasm platform. The currently supported
GLFW API is 3.4.

[![emscripten - TBD](https://img.shields.io/badge/emscripten-TBD-blue)](https://emscripten.org)
[![emscripten - 4.0.1](https://img.shields.io/badge/emscripten-4.0.1-blue)](https://emscripten.org)
[![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)
[![GLFW - 3.4.0](https://img.shields.io/badge/GLFW-3.4.0-blue)](https://www.glfw.org/)
[![License](https://img.shields.io/badge/License-Apache%20License%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
Expand Down Expand Up @@ -212,7 +212,7 @@ emcc --use-port=contrib.glfw3:disableWarning=true:disableMultiWindow=true main.c
> #### Note about availability in Emscripten
> | Emscripten | this port |
> |------------|----------------|
> | TBD | 3.4.0.20250112 |
> | 4.0.1 | 3.4.0.20250112 |
> | 4.0.0 | 3.4.0.20241230 |
> | 3.1.69 | 3.4.0.20241004 |
> | 3.1.66 | 3.4.0.20240907 |
Expand Down Expand Up @@ -250,10 +250,11 @@ Check the [Building](docs/Building.md) page for details on how to build this pro
Release Notes
-------------
#### 3.4.0.20250112 - 2025-01-12 | Emscripten TBD
#### 3.4.0.20250112 - 2025-01-12 | Emscripten 4.0.1
- Added support for `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
- Re-enable GL extensions by default (regression introduced in 3.4.0.20241230). Fixes #13.
- Changed port to automatically set the proper Emscripten flags to enable `GLFW_CONTEXT_VERSION_MAJOR`. Fixes #14.
#### 3.4.0.20241230 - 2024-12-30 | 4.0.0
Expand Down
21 changes: 10 additions & 11 deletions docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,11 @@ In this case, it is a WebGL context created using the Emscripten call `emscripte
This implementation supports the window hints: `GLFW_CONTEXT_VERSION_MAJOR` and
`GLFW_CONTEXT_VERSION_MINOR`.
> [!CAUTION]
> At this moment, the Emscripten implementation ignores the major version unless the `-sMAX_WEBGL_VERSION=2` compiler
> flag is provided
> * No flag => WebGL 1.0 regardless of `GLFW_CONTEXT_VERSION_MAJOR`
> * `-sMIN_WEBGL_VERSION=2` => WebGL 2.0 regardless of `GLFW_CONTEXT_VERSION_MAJOR`
> * `-sMAX_WEBGL_VERSION=2` => WebGL 1.0 or 2.0 depending on value of `GLFW_CONTEXT_VERSION_MAJOR`
> [!TIP]
> Since Emscripten 4.0.1, when using the port, it automatically sets the Emscripten linker
> flag `-sMAX_WEBGL_VERSION=2` to enable choosing the OpenGL version via the
> `GLFW_CONTEXT_VERSION_MAJOR` window hint.
> Prior to Emscripten 4.0.1, you have to manually set it.
In addition, by default, the context created is set with `premultipliedAlpha=true`.
Expand Down Expand Up @@ -550,7 +549,7 @@ As of initial release, I ran the following experiment on both implementations us
## Implementation size (update)
![emscripten - 3.1.74](https://img.shields.io/badge/emscripten-3.1.74-blue)
![emscripten - 4.0.1](https://img.shields.io/badge/emscripten-4.0.1-blue)
![emscripten-glfw-3.4.0.20250112](https://img.shields.io/badge/emscripten--glfw-3.4.0.20250112-blue)
```text
Expand All @@ -563,10 +562,10 @@ As of initial release, I ran the following experiment on both implementations us
> emcc --use-port=contrib.glfw3:disableWarning=true:disableJoystick=true:disableMultiWindow=true main.cpp -O2 -o /tmp/build/index.html
```
| Mode | `library_glfw.js` | This implementation | Delta |
|-------------------|----------------------------------------|------------------------------------------|-------|
| Release | js: 103917, wasm: 13904, total: 117821 | js: 58854, wasm: 73832, total: 132686 | 1.13x |
| Release (minimal) | - | js: 56630, wasm: 66486, total: 123116 | 1.04x |
| Mode | `library_glfw.js` | This implementation | Delta |
|-------------------|---------------------------------------|--------------------------------------|--------|
| Release | js:103492, wasm:13831, total:117323 | js:59906, wasm:73001, total:132907 | 13.28% |
| Release (minimal) | - | js:57682, wasm:65877, total:123559 | 5.31% |
> [!NOTE]
> The good news is that Emscripten is improving and this implementation is benefitting from it.
Expand Down

0 comments on commit 1da84fa

Please sign in to comment.