aboutsummaryrefslogtreecommitdiff
path: root/core/sys/wasm/js
Commit message (Collapse)AuthorAgeFilesLines
* import cleanupjakubtomsu6 days2-9/+9
|
* Added 'set_document_title' to be able to rename the tabKarl Zylinski2025-12-292-0/+7
|
* Fix bugs in odin.js:GetActiveUniformBlockNameKarl Zylinski2025-12-291-7/+11
|
* Added CheckFramebufferStatus to WebGL bindingsKarl Zylinski2025-12-291-0/+3
|
* More webgl bindings and fixesKarl Zylinski2025-12-271-7/+22
|
* More allocator-aware webgl bindings and added more missing bindings.Karl Zylinski2025-12-261-0/+21
|
* WebGL: Add GetActiveAttrib bindingKarl Zylinski2025-12-261-0/+21
|
* sys/wasm/js: fix vet errorLaytan Laats2025-12-221-1/+1
|
* js: improve warning about conflicting memory strategiesLaytan Laats2025-12-211-1/+1
|
* Fix #5843Courtney Strachan2025-10-231-3/+9
|
* Fix #5225 wasm odin.js undefined this.memxenobas2025-10-051-2/+2
|
* Add `add/remove_document_event_listener()` to `core:sys/wasm/js`Bailey Gibbons2025-08-223-0/+64
|
* Fix some webgl bindingsAlex Riedl2025-08-091-0/+37
|
* Simplified function call to loadCstringDirectAlexander Lunsford2025-05-301-7/+3
|
* Fix odin.js loadCstring to use pointer address correctly.Alexander Lunsford2025-05-301-1/+1
|
* Prevent odin.js from printing empty line in the console for the ending "\n"Jonathan Tron2025-03-261-6/+8
|
* fix tabsLaytan Laats2025-03-211-8/+8
|
* Prevent registering the same event listener twice on the same element with ↵Jonathan Tron2025-03-211-2/+9
| | | | the exact same data in wasm.
* Fix add/remove event listeners in `core:sys/wasm`Jonathan Tron2025-03-203-29/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were multiple issues here: 1. listeners stored in the same key overwriting the previous one 2. missing `use_capture` parameter in `remove_event_listener`/`remove_window_event_listener` The key used to store the listener function in `listenerMap` was a javascript `Object`, when used as a key it was thus serialized to the string `"[object Object]"`, meaning all listeners where effectively set to the same key when calling `add_event_listener`/`add_window_event_listener`. Later on when calling `remove_event_listener`/`remove_window_event_listener`, it then tried to remove the incorrect one or none at all if there was a mix of the same event name registered on an element or the window. To fix I implemented a function `listener_key` in the javascript code which will generate a different key based on the event's: - `id`: dom element's id or 'window' (when event listener added to the window) - `name`: the event name (eg: `click`), each event handler should be removed for the event name it was register on. - `data`: we can register events with different data, each one generate a new listener which has to be removed. - `callback`: same as `data`, if you register two similar handler but with two different callback, each one should be removed. - `useCapture`: this one is a bit tricky, but when you register an event handler in javascript, if you don't pass `useCapture`, it defaults to `false`. When you remove an handler, you have to pass the exact same `useCapture` option you registered it with. In this case, we allowed to register an event with different `useCapture`, but didn't allow to pass the `useCapture` when removing it. We always called `removeEventListener` without the `useCapture` parameter which removed the handler properly only when it was registered with `useCapture=false`. I also switched the `WasmMemoryInterface.listenerMap` from `{}` (javascript object) to a `new Map()`, which is available everywhere nowadays.
* Merge pull request #4933 from laytan/js-open-bindinggingerBill2025-03-132-1/+9
|\ | | | | core/sys/wasm/js: add `open` binding to `window.open`
| * core/sys/wasm/js: add `open` binding to `window.open`Laytan Laats2025-03-122-1/+9
| |
* | Merge pull request #4932 from laytan/js-pointer-event-and-charcodegingerBill2025-03-132-0/+48
|\ \ | | | | | | core/sys/wasm/js: add pointer event info and add charCode to keyboard
| * | core/sys/wasm/js: add pointer event info and add charCode to keyboard eventsLaytan Laats2025-03-122-0/+48
| |/
* | Merge pull request #4931 from laytan/webgl-improvementsgingerBill2025-03-131-0/+10
|\ \ | | | | | | webgl: add `BlendEquationSeparate` and `GetParameter4i`
| * | webgl: add `BlendEquationSeparate` and `GetParameter4i`Laytan Laats2025-03-121-0/+10
| |/ | | | | | | | | | | | | | | | | `GetParameter4i` can be used to retrieve the current scissor rect, or the curent viewport, which was previously impossible. Also adds `BlendEquationSeparate` which seemed to be missing. Also removes an instance of `do`.
* / core/sys/wasm/js: improve gamepad APILaytan Laats2025-03-122-11/+46
|/ | | | | | 1. Properly set `id` and `mapping` on the `get_gamepad_state` result 2. Increase `id` limit to 96 bytes, connecting my DualShock 4 made it crash 3. If an `id` or `mapping` is longer than the limits, slice it and add `...`
* webgpu: fix cstring as parameter not loading correctlyLaytan Laats2025-01-091-1/+4
|
* Increase size of JS keyboard event key/code buffer sizep2jason2024-11-122-4/+4
|
* Merge pull request #4415 from p2jason/masterLaytan2024-11-011-14/+17
|\ | | | | Remove the event queue from odin.js and directly invoke callbacks so they are executed in context where prevent default is possible
| * Removed event hook callback from add_*_event_listener functionsp2jason2024-10-311-18/+4
| |
| * Removed event queue from add_*_event_listener JS functions and added event ↵p2jason2024-10-312-35/+43
| | | | | | | | hook callback
| * Changed boolean parameters to bit set in the add_*_event_listener functionsp2jason2024-10-251-6/+6
| |
| * Added parameters to the add_*_event_listener JS functions for stopping event ↵p2jason2024-10-242-11/+20
| | | | | | | | behavior
* | sys/wasm/js: add `set_element_style`Laytan Laats2024-10-262-0/+12
|/
* Pass delta time instead of current time to odin.js `step`gingerBill2024-09-291-2/+2
|
* Add gamepad supportgingerBill2024-09-223-32/+142
|
* Add gamepad eventsgingerBill2024-09-222-4/+47
|
* Add new js eventsgingerBill2024-09-221-2/+8
|
* Move `vendor:wasm/js` to `core:sys/wasm/js`gingerBill2024-09-228-0/+2728