ReadyForNextFrame() 공개 메소드

public ReadyForNextFrame ( ) : bool
리턴 bool
예제 #1
0
        private void gameLoop()
        {
            _soccerPitch = new SoccerPitch(pictureBox1.ClientRectangle.Width, pictureBox1.ClientRectangle.Height);

            _simulationStarted = true;

            PrecisionTimer timer = new PrecisionTimer(ParameterManager.Instance.FrameRate);

            while (!_stopEvent.WaitOne(0, true))
            {
                if (timer.ReadyForNextFrame() && !_simulationPaused)
                {
                    _soccerPitch.Update();
                }

                pictureBox1.Invalidate();
                Thread.Sleep(1);
            }

            _soccerPitch       = null;
            _simulationStarted = false;

            // a final call to repaint our current state
            pictureBox1.Invalidate();
        }
예제 #2
0
        private void gameLoop()
        {
            _soccerPitch = new SoccerPitch(pictureBox1.ClientRectangle.Width, pictureBox1.ClientRectangle.Height);

            _simulationStarted = true;

            PrecisionTimer timer = new PrecisionTimer(ParameterManager.Instance.FrameRate);
            while (!_stopEvent.WaitOne(0, true))
            {
                if (timer.ReadyForNextFrame() && !_simulationPaused)
                {
                    _soccerPitch.Update();
                }

                pictureBox1.Invalidate();
                Thread.Sleep(1);
            }

            _soccerPitch = null;
            _simulationStarted = false;

            // a final call to repaint our current state
            pictureBox1.Invalidate();
        }