예제 #1
0
 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;
            }
        }
예제 #3
0
        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));
     }
 }
예제 #5
0
 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);
         }
     }
 }