public void Tick(float dtime) { if (ogg == null) { return; } if (Root.Instance.Time - Id.LastBind > 5) { if (!Idle) { Cheetah.Console.WriteLine("suspending video thread."); UpdateThread.Suspend(); Idle = true; } } else { if (Idle) { Cheetah.Console.WriteLine("resuming video thread."); UpdateThread.Resume(); Idle = false; } Time += dtime; UpdateSurface(); } }
protected void StopThread() { ExitThread = true; if (Idle) { UpdateThread.Resume(); } System.Console.WriteLine("stopping video update thread..."); UpdateThread.Join(); System.Console.WriteLine("video update thread ended."); }