Added to_outside accessible for JavaScript to offset a pointer from the flyff client, solving a bug around text input

This commit is contained in:
Knaapchen 2022-11-16 22:02:50 +01:00
parent 2fa1a801a3
commit c477678e60
1 changed files with 5 additions and 0 deletions

View File

@ -67,8 +67,13 @@ void get_text(const std::string& text) {
std::cout << text << " = \"" << result << "\"" << std::endl;
}
uintptr_t to_outside(uint32_t ptr) {
return fugg::wasm::kMemory.address_of(ptr);
}
EMSCRIPTEN_BINDINGS(fugg) {
emscripten::function("get_text", &get_text);
emscripten::function("to_outside", &to_outside);
};
int main() {