Begin work on Event System for js_wasm32 target

This commit is contained in:
gingerBill
2022-05-09 16:58:34 +01:00
parent 253ecd55a0
commit 6f1cc3946b
7 changed files with 877 additions and 253 deletions
+22
View File
@@ -0,0 +1,22 @@
//+build js wasm32
package wasm_js_interface
foreign import dom_lib "odin_dom"
@(default_calling_convention="contextless")
foreign dom_lib {
get_element_value_f64 :: proc(id: string) -> f64 ---
get_element_min_max :: proc(id: string) -> (min, max: f64) ---
set_element_value :: proc(id: string, value: f64) ---
}
get_element_value_string :: proc(id: string, buf: []byte) -> string {
@(default_calling_convention="contextless")
foreign dom_lib {
@(link_name="get_element_value_string")
_get_element_value_string :: proc(id: string, buf: []byte) -> int ---
}
n := _get_element_value_string(id, buf)
return string(buf[:n])
}