improved bindings
This commit is contained in:
parent
acc7d4fa34
commit
aae349f803
8 changed files with 69 additions and 82 deletions
2
samples/HelloWorld/README.md
Normal file
2
samples/HelloWorld/README.md
Normal 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.
|
||||
7
samples/HelloWorld/main.cpp
Normal file
7
samples/HelloWorld/main.cpp
Normal 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);
|
||||
}
|
||||
23
samples/HelloWorld/project.json
Normal file
23
samples/HelloWorld/project.json
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue