Commit graph

11 commits

Author SHA1 Message Date
Olivier Goffart
ab7ae9f3e2 Some refactoring of the rust generated code
Always use a Pin<Rc> for the component. (This is required to support repeater
within repeater as well anyway)
Do not use the context within the binding. We can get along by simply capturing
a weak pointer to the component
2020-07-13 16:37:54 +02:00
Simon Hausmann
1404cb73ae Add support for embedding resources in the rust generator
This is relatively straight-forward via a pass in the compiler to
collect the resources to embed and then use include_bytes! (once per
resource).

What's really annoying is that the rust resource enum can't store a
&'static [u8] because cbindgen doesn't represent that, probably because
the slice representation isn't guaranteed to stay as it is. So instead
this, for now, uses raw pointers.
2020-06-09 22:54:29 +02:00
Simon Hausmann
82a7c3e070 Change rust-wasm example to use the separate file compilation
This makes it easier to switch on resource embedding then :-)
2020-06-09 22:54:29 +02:00
Simon Hausmann
a176f08b13 Change rustwasm example to plus-minus, minus the image.
Next step though is to convert to the external .60 file build.
2020-06-08 17:06:53 +02:00
Simon Hausmann
fb2b12c28a Implement basic text rendering on the wasm port
Based on Olivier's suggestion, the text rendering primitive is created
by painting the text onto a temporary HTML canvas
element and binding that to a texture.
2020-06-08 17:00:59 +02:00
Olivier Goffart
619e21295d reformat 2020-05-28 17:15:11 +02:00
Olivier Goffart
dd756ef112 Adapt the parser to parse := instead of = 2020-05-25 10:46:00 +02:00
Simon Hausmann
18a2b7748f Silence VS code warning
... when not targeting wasm.
2020-05-13 13:27:15 +02:00
Simon Hausmann
6f98e2ea56 Fix cargo warning
For now, always depend on console_error_panic_hook. It's useful :-)
2020-05-13 12:08:00 +02:00
Simon Hausmann
3d604b1a0c Ignore the dist directory 2020-05-13 12:07:38 +02:00
Simon Hausmann
e313f39490 Add simple rust wasm test
Needs an initial "npm install" and then "npm start" will build and launch it in the browser.
2020-05-13 11:24:51 +02:00