private static void threadmethod() { Chalk chalk = new Chalk(Canvainfo.handPtr, Canvainfo.height, Canvainfo.width, new Color4(0f, 0f, 0f)); Eraser eraser = new Eraser(Canvainfo.handPtr, Canvainfo.height, Canvainfo.width, new Color4(0f, 0f, 0f)); Sweep sweep = new Sweep(Canvainfo.handPtr, Canvainfo.height, Canvainfo.width, new Color4(0f, 0f, 0f)); while (true) { if (Pointtrace.Flag == 1) { switch (Tooltype.type) { case 1: chalk.Render(Pointtrace.GetAllPoint(), Pointtrace.GetPointlist()); break; case 2: eraser.Render(Pointtrace.GetAllPoint(), Pointtrace.GetPointlist()); break; case 3: sweep.Render(Pointtrace.GetAllPoint(), Pointtrace.GetPointlist()); break; } } Thread.Sleep(1); } }