call oc_on_mouse_wheel() when getting a wheel event

This commit is contained in:
Reuben Dunnington 2023-09-18 19:17:31 -07:00
parent 762d2d9d10
commit 0d839a9767
Signed by: rdunnington
GPG Key ID: 4EC5290E704FD482
1 changed files with 14 additions and 0 deletions

View File

@ -680,6 +680,20 @@ i32 orca_runloop(void* user)
} }
break; break;
case OC_EVENT_MOUSE_WHEEL:
{
if(exports[OC_EXPORT_MOUSE_WHEEL])
{
const void* args[2] = { &event->mouse.deltaX, &event->mouse.deltaY };
M3Result res = m3_Call(exports[OC_EXPORT_MOUSE_WHEEL], 2, args);
if(res)
{
ORCA_WASM3_ABORT(app->env.m3Runtime, res, "Runtime error");
}
}
}
break;
case OC_EVENT_MOUSE_MOVE: case OC_EVENT_MOUSE_MOVE:
{ {
if(exports[OC_EXPORT_MOUSE_MOVE]) if(exports[OC_EXPORT_MOUSE_MOVE])