Milepost UI demo #18
Loading…
Reference in New Issue
No description provided.
Delete Branch "ilidemi/orca:ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #7, porting UI demo from Milepost with minor adjustments. Nitpicks are welcome.
Notes:
Just getting an example running, widgets will come separately.
Also, the Open Sans font is duplicated in /data. Seems silly but not sure if there's a way to reference resources within wasm
Since
mp_clock_init()
is called by the host, we can remove_OrcaClockInit()
and the G_EXPORT_CLOCK_INIT descriptor.Your
_OrcaGetRawEventPtr()
solution works, although we could also just have a global and get its offset withm3_FindGlobal
.We're only targeting little-endian platforms for the mvp, but marshalling seems to be kind of inevitable at some point when passing structs to/from wasm. (For now we wing it by relying on struct layout being consistent between the host and the guest. This won't necessarily be the case once we want to support other languages).
I tend to prefer prefixing include directives with the folder of the included file if it's not in the same folder of the file including it, so ideally we can just pass
-I../../milepost/src
to the compiler, rather than all the subdirectories ofmilepost/src
.Could you also add a call to the binding generation script for
clock_api.json
in the macos build script?Just FYI, I'm getting GL errors and a black screen with the current version of milepost:
The last commits don't touch graphics so I'm assuming it's unrelated. Verified raw events and clock via logging.
Ok, there's a problem with gl buffers alignment, which is driver dependent. I'll get that fixed soon.
But there's also I think a problem with how you get the raw event slot. If I'm not mistaken, right now you get the address of
_OrcaRawEventPtr
and you write events to that location, which has the size of a pointer, not an event struct. The location you write to should really be_OrcaRawEvent
, and you shouldn't need_OrcaRawEventPtr
right?(Btw, I kinda liked the way you changed the naming convention of
event handlers
toexport
, since we'll probably have exported functions that are not really handlers. I think you can keep this even if we remove GetRawEventPtr())m3_FindGlobal
indeed returns the address and not the value, I got confused by the .f64Value and .f32Value in the union. Memory corruption from writing to the pointer of pointer was also the cause for black screen - shows how interconnected raw C is. Now rendering is at 80% on the NVidia GPU :)Hey! Looks great (tiling bug thanks to opengl alignment rules and my own stupidity. I'm fixing that right after merging this one).