If draw line was made into a direct function call would it become faster than message passing, or are those older messages which were made into functions still using the same system but only changed to direct function calls for convenience?
If draw data was saved into a Lua module that the render script imported and the game filled with draw requests, and if the render script had primitive draw functions, would that be faster than waiting on message passing?
If I draw a line between a point on the screen and my mouse x,y I can notice lag.
msg.post("@render:", "draw_line", { start_point = go.get_position("."), end_point = vmath.vector3(action.x, action.y, 0), color = vmath.vector4(1, 1, 1, 1) } )
Is there something about this that makes it slow? I tested on Win and Mac and both have the end point of the line drag behind the actual mouse cursor as it moves.
Maybe make some kind of input, such as current raw mouse position, directly available in the render script? Then instead of passing input data that may be stale, pass a token which tells it to use the raw mouse position data.