コード例 #1
0
        /// <summary>
        /// Called by CryEngine. Do not call directly.
        /// </summary>
        public override void OnPreRender()
        {
            // Sleep if necessary, to match target FPS.
            if (_nextFrameTime > DateTime.Now)
            {
                System.Threading.Thread.Sleep(Math.Max(0, (int)(_nextFrameTime - DateTime.Now).TotalMilliseconds));
            }
            if (_monoTargetFps != null && _monoTargetFps.GetIVal() > 0)
            {
                _nextFrameTime = DateTime.Now.AddSeconds(1.0f / (float)_monoTargetFps.GetIVal());
            }

            var renderReceivers = new List <IGameRenderReceiver> (_renderReceivers);

            foreach (IGameRenderReceiver obj in renderReceivers)
            {
                obj.OnRender();
            }
        }
コード例 #2
0
 internal void OnValueChanged(ICVar var)
 {
     m_value = var.GetIVal();
 }