summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.c b/main.c
index adb3e14..bb9937f 100644
--- a/main.c
+++ b/main.c
@@ -321,11 +321,18 @@ redraw(void)
void
drawproc(void *)
{
+ uvlong t0, Δt;
+
threadsetname("drawproc");
+ t0 = nsec();
for(;;){
shootcamera(maincam, model, modeltex, shader);
- nbsend(drawc, nil);
+ Δt = nsec() - t0;
+ if(Δt > HZ2MS(60)*1000000ULL){
+ nbsend(drawc, nil);
+ t0 += Δt;
+ }
}
}