Commit 7a58731
authored
[contrib.glfw3] New version (bug fix + emscripten_html5_remove_event_listener use) (#25972)
I just pushed a new version with the following release notes:
- Fixed [#24](pongasoft/emscripten-glfw#24):
`glfwMakeContextCurrent` non-compliance
- Use `emscripten_html5_remove_event_listener` which makes the library
safer to use (it no longer iterferes with the client code). Note that
the client should also use `emscripten_html5_remove_event_listener` in
order not to interfere with the library.
@sbc100 This new version in particular contains the changes to use the
newly introduced `emscripten_html5_remove_event_listener`. The demo/test
program has been updated to demonstrate that the library is doing the
"right" thing, meaning NOT interfering with the handlers set by the
client code and also removing all its handlers on exit (this is how I
found out that there was an issue with one of the listeners setting 2
listeners for Safari).
This is an output that demonstrates the test:
```
Before glfwInit() | Event Handlers = 0 main.js:104:150
After glfwInit() | Event Handlers = 12 main.js:104:150
GLFW: 3.4.0 | Emscripten | pongasoft/[email protected] | Platform: 0x60006 main.js:67:481
emscripten: v4.0.21 main.js:67:481
After glfwCreateWindow(window1) | Event Handlers = 19 main.js:104:150
After glfwCreateWindow(window2) | Event Handlers = 26 main.js:104:150
canvas1 | WebGL: OpenGL ES 3.0 (WebGL 2.0) | Apple M1, or similar main.js:67:481
canvas2 | WebGL: OpenGL ES 3.0 (WebGL 2.0) | Apple M1, or similar main.js:67:481
After adding application event listener | Event Handlers = 27 main.js:104:150
After glfwDestroyWindow(canvas2) | Event Handlers = 20 main.js:104:150
After glfwDestroyWindow(canvas1) | Event Handlers = 13 main.js:104:150
After glfwTerminate() | Event Handlers = 1 main.js:104:150
After removing application event listener | Event Handlers = 0 main.js:104:150
```1 parent 0f3d2e6 commit 7a58731
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
0 commit comments