private void OnRegistered(object sender, CameraRegistrationEvent e) { if (this.started && this.MainNeedsSyncing()) { this.ForceSyncTaggedMainCamera(); } }
public static void Release(CameraRegistrationEvent ev) { if (ev == null) { return; } ev._camera = null; if (_event == null) { _event = ev; } }
private void OnUnregistered(object sender, CameraRegistrationEvent e) { var cam = e.Camera; if (_main == cam) { _main = null; if (this.started && !GameLoopEntry.ApplicationClosing) { this.ForceSyncTaggedMainCamera(); } } }
public static CameraRegistrationEvent GetTemp(ICamera cam) { if (_event != null) { var ev = _event; _event = null; ev._camera = cam; return(ev); } else { return(new CameraRegistrationEvent(cam)); } }
public static void Unregister(ICamera cam) { if (cam == null) { throw new System.ArgumentNullException("cam"); } if (GameLoopEntry.ApplicationClosing) { return; } if (_cameras.Remove(cam)) { var e = CameraUnregistered; if (e != null) { var ev = CameraRegistrationEvent.GetTemp(cam); e(null, ev); } } }