Exemplo n.º 1
0
        public GameLoop(LoopCallback callback)
        {
            _callback = callback;

            _gameLoopThread = new Thread(new ThreadStart(TheLoop));
            _gameLoopThread.Start();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the FastLoop class
 /// </summary>
 /// <param name="callback">A callback</param>
 public FastLoop(LoopCallback callback)
 {
     this.callback = callback;
     Application.Idle += new EventHandler(this.OnApplicationEnterIdle);
     this.stopwatch = Stopwatch.StartNew();
     this.previousElapsedTime = TimeSpan.Zero;
 }
 public static void Loop <T>(this IEnumerator <T> collection, LoopCallback <T> callback)
 {
     while (collection.MoveNext())
     {
         callback(collection.Current);
     }
 }
Exemplo n.º 4
0
        public FastLoop(LoopCallback callback)
        {
            _timer = new PreciseTimer();

            _callback = callback;

            Application.Idle += OnApplicationEnterIdle;
        }
    public static void Loop <T>(this IEnumerable <T> collection, LoopCallback <T> callback)
    {
        IEnumerator <T> e = collection.GetEnumerator();

        while (e.MoveNext())
        {
            callback(e.Current);
        }
    }
Exemplo n.º 6
0
        public GameLoop(LoopCallback callback)
        {
            _callback = callback;

            msg = new Win32Message();

            Application.Idle += Application_Idle;

            //_gameLoopThread = new Thread(new ThreadStart(TheLoop));
            //_gameLoopThread.Start();
        }
 public FastLoop(LoopCallback callback)
 {
     _callback         = callback;
     Application.Idle += new EventHandler(OnApplicationEnterIdle);
 }
Exemplo n.º 8
0
 public FastLoop(LoopCallback callback)
 {
     _callback = callback;
     Application.Idle += new EventHandler(OnApplicationEnterIdle);
 }
Exemplo n.º 9
0
 internal extern static IntPtr pcap_loop(IntPtr p, int cnt, [MarshalAs(UnmanagedType.FunctionPtr)] LoopCallback callback, IntPtr user);
Exemplo n.º 10
0
 public FastLoop(LoopCallback callback)
 {
     this.callback     = callback;
     Application.Idle += OnApplicationEnterIdle;
 }
Exemplo n.º 11
0
 public FastLoop(LoopCallback callback)
 {
     _callback = callback;
     Application.Idle += OnApplicationEnterIdle;
 }
Exemplo n.º 12
0
 //get the passed in method and set it as the callback
 public FastLoop(LoopCallback callback)
 {
     _callback = callback;
     //check to see whether the application is in idle mode, if so run OnApplicationEnterIdle
     Application.Idle += new EventHandler(OnApplicationEnterIdle);
 }
Exemplo n.º 13
0
 //get the passed in method and set it as the callback
 public FastLoop(LoopCallback callback)
 {
     _callback = callback;
     //check to see whether the application is in idle mode, if so run OnApplicationEnterIdle
     Application.Idle += new EventHandler(OnApplicationEnterIdle);
 }