private static void startWorker(GraphicsWorker worker) { Thread workerThread = new Thread((ThreadStart) delegate { runWorker(worker); }); StreamGraphics.Insance.workerThreads.Add(workerThread); workerThread.Start(); }
private static void runWorker(GraphicsWorker worker) { try { worker.run(); } catch (ThreadInterruptedException) { return; } }
public GameScreen() { _graphicsWorker = new GraphicsWorker(0, this); AddWorker(new PhysicsWorker(new GameTime(), 60)); }
public static void registerWorker(GraphicsWorker worker) { startWorker(worker); StreamGraphics.Insance.workers.Add(worker); }