private MyRenderThread(MyGameTimer timer, bool separateThread) { m_timer = timer; m_waiter = new WaitForTargetFrameRate(timer, 120.0f); m_separateThread = separateThread; if (separateThread) { SystemThread = new Thread(new ParameterizedThreadStart(RenderThreadStart)); //RenderThread.Priority = ThreadPriority.AboveNormal; SystemThread.IsBackground = true; // Do not prevent app from terminating SystemThread.Name = "Render thread"; SystemThread.CurrentCulture = CultureInfo.InvariantCulture; SystemThread.CurrentUICulture = CultureInfo.InvariantCulture; } else { SystemThread = Thread.CurrentThread; } }