improved bindings

This commit is contained in:
Jorijn van der Graaf 2025-02-12 22:22:06 +01:00
commit aae349f803
8 changed files with 69 additions and 82 deletions

View file

@ -0,0 +1,2 @@
This sample demonstrates a simple hello world.
Run ``crafter-webbuild serve -c debug`` and go to ``localhost:8080`` to view it.

View file

@ -0,0 +1,7 @@
import Crafter.CppDOM;
int main(){
void* body = Crafter::CppDOM::Bindings::GetElementById("body");
Crafter::CppDOM::Bindings::SetInnerHTML(body, "Hello World!");
Crafter::CppDOM::Bindings::FreeJs(body);
}

View file

@ -0,0 +1,23 @@
{
"name": "hello-world",
"configurations": [
{
"name": "debug",
"standard": "c++26",
"source_files": ["main"],
"module_files": [],
"additional_files": [],
"build_dir": "./build",
"output_dir": "./bin",
"optimization_level": "0",
"target": "wasm32-unknown-wasi",
"type": "executable",
"dependencies": [
{
"path":"/home/jorijn/repos/Crafter.CppDOM/project.json",
"configuration":"debug"
}
]
}
]
}