private void DoRayTrace(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; Int32 algorithm = 0; switch (renderMode) { case RenderMode.RayTraceMode: algorithm = 0; break; case RenderMode.OpenCLTraceMode: algorithm = 1; break; case RenderMode.PathTrace2Mode: algorithm = 2; break; } result = Win32Functions.Render( algorithm, tempFileName, "", settings.Resolution, NativeRayTracerStartRenderCallback, NativeRayTracerEndRenderCallback, NativeRayTracerProgressCallback, NativeRayTracerSetPixelCallback); }
public void Cancel() { backgroundWorker.CancelAsync(); Win32Functions.CancelRender(); exitAppWhenFinished = true; }