Scheduling tasks

How can I schedule a task to be run before rendering in every step? I am running the physics simulation in another thread and I want to update graphics position and orientation before rendering.



Thanks.

Use an AppState.